浏览代码

Merge pull request #69680 from LucasLaukka/bugfix-line_edit

Fix color picker showing incorrect number of digits when changing display scale
Rémi Verschelde 2 年之前
父节点
当前提交
9ba3f9d1db
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      scene/gui/line_edit.cpp

+ 2 - 2
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;
 			}