Browse Source

Fix LineEdit clear button for asymmetric stylebox

(cherry picked from commit 1e6747d185dfec76713101141c4b1bd4f08288d3)
Haoyu Qiu 3 years ago
parent
commit
4a83c2944c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/gui/line_edit.cpp

+ 1 - 1
scene/gui/line_edit.cpp

@@ -678,7 +678,7 @@ bool LineEdit::_is_over_clear_button(const Point2 &p_pos) const {
 		return false;
 	}
 	Ref<Texture> 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;
 }