浏览代码

Merge pull request #61495 from timothyqiu/asymmetric-le

Fix LineEdit clear button for asymmetric stylebox
Rémi Verschelde 3 年之前
父节点
当前提交
a837accc5d
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/line_edit.cpp

+ 1 - 1
scene/gui/line_edit.cpp

@@ -695,7 +695,7 @@ bool LineEdit::_is_over_clear_button(const Point2 &p_pos) const {
 		return false;
 	}
 	Ref<Texture2D> icon = Control::get_theme_icon(SNAME("clear"));
-	int x_ofs = get_theme_stylebox(SNAME("normal"))->get_offset().x;
+	int x_ofs = get_theme_stylebox(SNAME("normal"))->get_margin(SIDE_RIGHT);
 	return p_pos.x > get_size().width - icon->get_width() - x_ofs;
 }