From c89ee712974a2bd5b023ffd34ca143aff17d9ba5 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Sun, 9 Jan 2022 21:25:28 +0200 Subject: [PATCH] Fix button multiline text alignment. --- scene/gui/button.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 25e931c2870..dc030d6f3d6 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: {