GDQuest / learn-gdscript

Learn Godot's GDScript programming language from zero, right in your browser, for free.
https://gdquest.github.io/learn-gdscript/
Other
2.11k stars 160 forks source link

PracticeHint RichTextLabel width is hard-coded #12

Closed NathanLovato closed 2 years ago

NathanLovato commented 2 years ago

There was a bug causing hints to overflow their container, fixed in https://github.com/GDQuest/learn-gdscript/commit/6e3216677565bb5f4047753ff6b947d363539a30There were issues with the RichTextLabel in PracticeHint calculating its height too early, and RichTextLabel.get_content_height() being unreliable, so as the panel it’s in has a fixed width, I just gave it a fixed width from the get-go.If we’re going to resize the parent panel, this will break a bit. So we should figure out a way to make it work reliably.I think a solution would be to instantiate the RichTextLabel from GDScript and defer adding it as a child of the PracticeHint revealer until we have the revealer’s width set by its parent. That way, the Fit Content height feature of the RichTextLabel should instantly work.

YuriSizov commented 2 years ago

With the new revealer it doesn't seem to be a problem. So I removed the hardcoded values, as they are no longer needed and they were causing visual problems when a second scrollbar appeared.