diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-09 23:09:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-09 23:09:06 +0100 |
commit | 096b050d1c050cc3752c82678bdc3d0051e9b46b (patch) | |
tree | d4e337a51ea3cbb1f41a65e17040558af03e195c | |
parent | b6b81e800a2a1dde5795b7aa45ae7aa2e3e80f5b (diff) | |
parent | c89ee712974a2bd5b023ffd34ca143aff17d9ba5 (diff) |
Merge pull request #56654 from bruvzg/fix_button_text_align
Fix button multiline text alignment.
-rw-r--r-- | scene/gui/button.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 25e931c287..dc030d6f3d 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -302,6 +302,8 @@ void Button::_notification(int p_what) { Point2 text_ofs = (size - style->get_minimum_size() - icon_ofs - text_buf->get_size() - Point2(_internal_margin[SIDE_RIGHT] - _internal_margin[SIDE_LEFT], 0)) / 2.0; + text_buf->set_alignment(align_rtl_checked); + text_buf->set_width(text_width); switch (align_rtl_checked) { case HORIZONTAL_ALIGNMENT_FILL: case HORIZONTAL_ALIGNMENT_LEFT: { |