From e1148cc452c1a627974d5d63e95cfc12bf6fa319 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Mon, 31 Jan 2022 13:30:35 +0200 Subject: Revert "Fix control node transform animation jitter with pivot offset" This reverts commit dfb7d46a2aaf9bef2c7dd067e699e70291062fb6. --- scene/gui/control.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'scene/gui/control.cpp') diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 562ea8a8f7..7ebc5c27f8 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -576,6 +576,11 @@ void Control::_update_canvas_item_transform() { Transform2D xform = _get_internal_transform(); xform[2] += get_position(); + // 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(); + } + RenderingServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), xform); } -- cgit v1.2.3