Merge pull request #61495 from timothyqiu/asymmetric-le

Fix LineEdit clear button for asymmetric stylebox
This commit is contained in:
Rémi Verschelde 2022-05-31 08:55:21 +02:00 committed by GitHub
commit a837accc5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -695,7 +695,7 @@ bool LineEdit::_is_over_clear_button(const Point2 &p_pos) const {
return false; return false;
} }
Ref<Texture2D> icon = Control::get_theme_icon(SNAME("clear")); Ref<Texture2D> icon = Control::get_theme_icon(SNAME("clear"));
int x_ofs = get_theme_stylebox(SNAME("normal"))->get_offset().x; int x_ofs = get_theme_stylebox(SNAME("normal"))->get_margin(SIDE_RIGHT);
return p_pos.x > get_size().width - icon->get_width() - x_ofs; return p_pos.x > get_size().width - icon->get_width() - x_ofs;
} }