Round the icon's drawing rect when drawing the button
Each component of the icon's drawing rect needs to be snapped to an integer.
This commit is contained in:
parent
c4279fe3e0
commit
82fef614ce
1 changed files with 2 additions and 0 deletions
|
@ -298,6 +298,7 @@ void Button::_notification(int p_what) {
|
||||||
icon_size = Size2(icon_width, icon_height);
|
icon_size = Size2(icon_width, icon_height);
|
||||||
}
|
}
|
||||||
icon_size = _fit_icon_size(icon_size);
|
icon_size = _fit_icon_size(icon_size);
|
||||||
|
icon_size = icon_size.round();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (icon_size.width > 0.0f) {
|
if (icon_size.width > 0.0f) {
|
||||||
|
@ -336,6 +337,7 @@ void Button::_notification(int p_what) {
|
||||||
icon_ofs.y = size.y - style_margin_bottom - icon_size.height;
|
icon_ofs.y = size.y - style_margin_bottom - icon_size.height;
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
|
icon_ofs = icon_ofs.floor();
|
||||||
|
|
||||||
Rect2 icon_region = Rect2(icon_ofs, icon_size);
|
Rect2 icon_region = Rect2(icon_ofs, icon_size);
|
||||||
draw_texture_rect(_icon, icon_region, false, icon_modulate_color);
|
draw_texture_rect(_icon, icon_region, false, icon_modulate_color);
|
||||||
|
|
Loading…
Reference in a new issue