diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index e17d008ca84..42f8306a981 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; }