summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2022-05-28 19:50:35 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2022-05-28 19:50:35 +0800
commite021fc94193275d2548aa24df0793ef3d3b51f7d (patch)
tree27d83659617b84be2b85b587df587f8512e9bec7 /scene
parent1f690f197a4fb0809afb2f59bf78e4d3d89fd847 (diff)
Fix LineEdit clear button for asymmetric stylebox
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/line_edit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 73188d6602..fd9db4ea1b 100644
--- a/scene/gui/line_edit.cpp
+++ b/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;
}