summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-15 22:09:18 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-15 22:09:18 +0100
commit9ba3f9d1db1c52c88f05f1c157a746d968c5dfaf (patch)
treedd9575eaf2031fb9821f8b308e888c7e40f757c3 /scene/gui
parent7975ac5a00e41c3e99387aa5b443a55004c16f89 (diff)
parent4e63395a7853be0880394c26f5dfa7605baa6e27 (diff)
Merge pull request #69680 from LucasLaukka/bugfix-line_edit
Fix color picker showing incorrect number of digits when changing display scale
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/line_edit.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index bd39ee3bb3..b8e2c76413 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -822,7 +822,7 @@ void LineEdit::_notification(int p_what) {
case HORIZONTAL_ALIGNMENT_FILL:
case HORIZONTAL_ALIGNMENT_LEFT: {
if (rtl) {
- x_ofs = MAX(style->get_margin(SIDE_LEFT), int(size.width - style->get_margin(SIDE_RIGHT) - (text_width)));
+ x_ofs = MAX(style->get_margin(SIDE_LEFT), int(size.width - Math::ceil(style->get_margin(SIDE_RIGHT) + (text_width))));
} else {
x_ofs = style->get_offset().x;
}
@@ -838,7 +838,7 @@ void LineEdit::_notification(int p_what) {
if (rtl) {
x_ofs = style->get_offset().x;
} else {
- x_ofs = MAX(style->get_margin(SIDE_LEFT), int(size.width - style->get_margin(SIDE_RIGHT) - (text_width)));
+ x_ofs = MAX(style->get_margin(SIDE_LEFT), int(size.width - Math::ceil(style->get_margin(SIDE_RIGHT) + (text_width))));
}
} break;
}