diff options
author | Juan Linietsky <reduzio@gmail.com> | 2023-04-05 18:53:32 +0200 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2023-04-06 13:57:13 +0200 |
commit | 104392ef4ea7b983b27c44de72adfc627500e814 (patch) | |
tree | 2a6cc0938c9254efc1c206527310b0caa25833db /scene/main/viewport.h | |
parent | 44d539465acca7592e0c88748e231fe5f151da37 (diff) | |
download | redot-engine-104392ef4ea7b983b27c44de72adfc627500e814.tar.gz |
Remove NOTIFICATION_MOVED_IN_PARENT
* This notification makes node children management very inefficient.
* Replaced by a NOTIFICATION_CHILDREN_CHANGED (and children_changed signal).
* Changed Canvas code (and similar) to use the above signal, to perform more efficiently.
This PR breaks compatibility (although this notification was very rarely used, even within the engine), but provides an alternate way to do the same.
It is required for the changes in #75627 to be entirely effective.
Diffstat (limited to 'scene/main/viewport.h')
-rw-r--r-- | scene/main/viewport.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 5213c0db01..f12e7921a3 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -376,6 +376,7 @@ private: double tooltip_delay = 0.0; bool roots_order_dirty = false; List<Control *> roots; + HashSet<ObjectID> canvas_parents_with_dirty_order; int canvas_sort_index = 0; //for sorting items with canvas as root bool dragging = false; bool drag_successful = false; @@ -468,6 +469,8 @@ private: virtual bool _can_consume_input_events() const { return true; } uint64_t event_count = 0; + void _process_dirty_canvas_parent_orders(); + protected: void _set_size(const Size2i &p_size, const Size2i &p_size_2d_override, bool p_allocated); @@ -480,6 +483,8 @@ protected: static void _bind_methods(); public: + void canvas_parent_mark_dirty(Node *p_node); + uint64_t get_processed_events_count() const { return event_count; } AudioListener2D *get_audio_listener_2d() const; |