mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 21:52:51 +00:00
Change GUI controls pixel snap to round halfway to +ve infinity
This commit is contained in:
parent
25de53e147
commit
cc45c2cdd3
@ -696,7 +696,7 @@ void Control::_update_canvas_item_transform() {
|
||||
|
||||
// We use a little workaround to avoid flickering when moving the pivot with _edit_set_pivot()
|
||||
if (is_inside_tree() && Math::abs(Math::sin(data.rotation * 4.0f)) < 0.00001f && get_viewport()->is_snap_controls_to_pixels_enabled()) {
|
||||
xform[2] = xform[2].round();
|
||||
xform[2] = (xform[2] + Vector2(0.5, 0.5)).floor();
|
||||
}
|
||||
|
||||
RenderingServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), xform);
|
||||
|
Loading…
Reference in New Issue
Block a user