Преглед на файлове

Merge pull request #61496 from timothyqiu/asymmetric-le-3.x

[3.x] Fix LineEdit clear button for asymmetric stylebox
Rémi Verschelde преди 3 години
родител
ревизия
51e52b5ed8
променени са 1 файла, в които са добавени 1 реда и са изтрити 1 реда
  1. 1 1
      scene/gui/line_edit.cpp

+ 1 - 1
scene/gui/line_edit.cpp

@@ -742,7 +742,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;
 }