From b7e06930aa8251296e9787ce4188accae797063d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 11 Mar 2021 11:01:48 +0100 Subject: [PATCH] Revert "Fix flicker in control nodes due to pivot offset" --- scene/gui/control.cpp | 5 +++++ scene/gui/scroll_container.cpp | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index d9926edfe21..829daedd25c 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); } diff --git a/scene/gui/scroll_container.cpp b/scene/gui/scroll_container.cpp index 541347992a3..fa87f5b4809 100644 --- a/scene/gui/scroll_container.cpp +++ b/scene/gui/scroll_container.cpp @@ -315,7 +315,6 @@ void ScrollContainer::_notification(int p_what) { r.size.height = minsize.height; } r.position += ofs; - r.position = r.position.floor(); fit_child_in_rect(c, r); }