mirror of
https://github.com/tiennm99/godot.git
synced 2026-08-05 08:22:59 +00:00
Fix wrong offset in Button when alignment is set to left
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user