gdquest-demos / godot-kickstarter-2019

Create your Own Games with Godot, the Free Game Engine: sources from the January Kickstarter project from GDQuest
MIT License
242 stars 269 forks source link

RichTextLabel and TextEdit bounding box resize tool #34

Closed henriiquecampos closed 5 years ago

henriiquecampos commented 5 years ago

I started working on a solution to close #28 and this is how it is currently.

ezgif com-video-to-gif

Currently it works on Control.rect_size so maybe this doesn't reflect its full intention, maybe it will be better to work on Control.rect_min_size instead so the RichTextLabel or the TextEdit would make their parent fit their content instead of being clipped to the parent's rect. If this is the case, lemme know.

henriiquecampos commented 5 years ago

I updated the behavior to force a size that fits the content vertically (only). As you can see it also forces the RichTextLabel or the TextEdit parents to fit their new rect, but when we undo the parent's rect isn't updated visually, we must refresh it manually (one way is to turn visibility on/off).

By the way I forgot to mention, but the shortcut for this operation is CTRL + R

ezgif com-video-to-gif

NathanLovato commented 5 years ago

Thanks, please ping me again when the PR's not WIP anymore

henriiquecampos commented 5 years ago

@NathanLovato I think is all good, just added a small docstring to describe it.