From 1e6747d185dfec76713101141c4b1bd4f08288d3 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sat, 28 May 2022 19:51:50 +0800 Subject: [PATCH] Fix LineEdit clear button for asymmetric stylebox --- scene/gui/line_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index e17d008ca84a..42f8306a981d 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -742,7 +742,7 @@ bool LineEdit::_is_over_clear_button(const Point2 &p_pos) const { return false; } Ref icon = Control::get_icon("clear"); - int x_ofs = get_stylebox("normal")->get_offset().x; + int x_ofs = get_stylebox("normal")->get_margin(MARGIN_RIGHT); return p_pos.x > get_size().width - icon->get_width() - x_ofs; }