From 2bae35353d49fbbd7a1b2530785b6ba75103fad6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 2 Mar 2020 16:35:16 +0100 Subject: [PATCH] Revert "Fix control node transform animation jitter with pivot offset" This reverts commit 15315f118ccd0a462eafa01801570c0dd887ca4d. It caused a regression: #36087. --- scene/gui/control.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index 4c70bd1d394..ae48a1356e6 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -462,6 +462,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(); + } + VisualServer::get_singleton()->canvas_item_set_transform(get_canvas_item(), xform); }