diff options
author | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-08-28 23:12:22 -0300 |
---|---|---|
committer | Michael Alexsander Silva Dias <michaelalexsander@protonmail.com> | 2019-08-28 23:12:22 -0300 |
commit | da5195fc927614aa9340bb1a1729428f0e5bbfbc (patch) | |
tree | a0ccca92b6c111bc9ae7b1cd0e747b1bcf362661 /scene | |
parent | 65d1b0b427cdccc5b2463cbc703b922d95075895 (diff) |
Fix wrong offset in Button when alignment is set to left
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/button.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp index 65e9cccd05..4ce3f18505 100644 --- a/scene/gui/button.cpp +++ b/scene/gui/button.cpp @@ -159,7 +159,11 @@ void Button::_notification(int p_what) { switch (align) { case ALIGN_LEFT: { - text_ofs.x = style->get_margin(MARGIN_LEFT) + icon_ofs.x + _internal_margin[MARGIN_LEFT] + get_constant("hseparation"); + if (_internal_margin[MARGIN_LEFT] > 0) { + text_ofs.x = style->get_margin(MARGIN_LEFT) + icon_ofs.x + _internal_margin[MARGIN_LEFT] + get_constant("hseparation"); + } else { + text_ofs.x = style->get_margin(MARGIN_LEFT) + icon_ofs.x; + } text_ofs.y += style->get_offset().y; } break; case ALIGN_CENTER: { |