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

[3.x] Fix LineEdit clear button for asymmetric stylebox
This commit is contained in:
Rémi Verschelde 2022-05-31 08:56:13 +02:00 committed by GitHub
commit 51e52b5ed8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}