From 7f317ef1bff223c9c43c4caebdfb6b1cfbe98a30 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Sun, 6 Aug 2023 09:25:03 +0200 Subject: [PATCH] Remove `CanvasItem::_invalidate_global_transform` The only use of that function can be replaced by `_notify_transform`, which makes the `propagate_call` unnecessary. As far as I can tell, the `data.blocked`-checks of `propagate_call` are not needed in this case, because `_invalidate_global_transform` causes no user-noticeable changes. --- scene/main/canvas_item.cpp | 7 +------ scene/main/canvas_item.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp index 855cad51e9c..0f2bf860790 100644 --- a/scene/main/canvas_item.cpp +++ b/scene/main/canvas_item.cpp @@ -147,10 +147,6 @@ void CanvasItem::_redraw_callback() { pending_update = false; // don't change to false until finished drawing (avoid recursive update) } -void CanvasItem::_invalidate_global_transform() { - _set_global_invalid(true); -} - Transform2D CanvasItem::get_global_transform_with_canvas() const { ERR_READ_THREAD_GUARD_V(Transform2D()); if (canvas_layer) { @@ -449,7 +445,7 @@ void CanvasItem::set_as_top_level(bool p_top_level) { if (!is_inside_tree()) { top_level = p_top_level; - propagate_call(SNAME("_invalidate_global_transform")); + _notify_transform(); return; } @@ -1067,7 +1063,6 @@ void CanvasItem::_validate_property(PropertyInfo &p_property) const { void CanvasItem::_bind_methods() { ClassDB::bind_method(D_METHOD("_top_level_raise_self"), &CanvasItem::_top_level_raise_self); - ClassDB::bind_method(D_METHOD("_invalidate_global_transform"), &CanvasItem::_invalidate_global_transform); #ifdef TOOLS_ENABLED ClassDB::bind_method(D_METHOD("_edit_set_state", "state"), &CanvasItem::_edit_set_state); diff --git a/scene/main/canvas_item.h b/scene/main/canvas_item.h index 51591e1ac66..36f0e179241 100644 --- a/scene/main/canvas_item.h +++ b/scene/main/canvas_item.h @@ -132,7 +132,6 @@ private: virtual void _top_level_changed_on_parent(); void _redraw_callback(); - void _invalidate_global_transform(); void _enter_canvas(); void _exit_canvas();