summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-08-05 21:16:21 +0200
committerGitHub <noreply@github.com>2022-08-05 21:16:21 +0200
commit15d1af11e2008512f4aaa32f731994b22b074636 (patch)
tree76d48fb089c18ef8ea83947e945caa50de8a5d1c
parent8f05263bd5417f1afeb46405a53a49c687b39240 (diff)
parent62d14ca22dc60359906c52689dee09ccb84060e2 (diff)
Merge pull request #63957 from YuriSizov/buttons-in-focus
Round icon position and size in buttons to make them look sharper
-rw-r--r--scene/gui/button.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/button.cpp b/scene/gui/button.cpp
index 9bcb061526..0a163b65ff 100644
--- a/scene/gui/button.cpp
+++ b/scene/gui/button.cpp
@@ -258,7 +258,8 @@ void Button::_notification(int p_what) {
}
if (icon_region.size.width > 0) {
- draw_texture_rect_region(_icon, icon_region, Rect2(Point2(), _icon->get_size()), color_icon);
+ Rect2 icon_region_rounded = Rect2(icon_region.position.round(), icon_region.size.round());
+ draw_texture_rect(_icon, icon_region_rounded, false, color_icon);
}
}