summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2019-08-28 23:12:22 -0300
committerMichael Alexsander Silva Dias <michaelalexsander@protonmail.com>2019-08-28 23:12:22 -0300
commitda5195fc927614aa9340bb1a1729428f0e5bbfbc (patch)
treea0ccca92b6c111bc9ae7b1cd0e747b1bcf362661 /scene/gui
parent65d1b0b427cdccc5b2463cbc703b922d95075895 (diff)
Fix wrong offset in Button when alignment is set to left
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/button.cpp6
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: {