summaryrefslogtreecommitdiffstats
path: root/scene/main/canvas_item.cpp
diff options
context:
space:
mode:
authorkit <kitbdev@gmail.com>2023-10-31 13:55:34 -0400
committerkit <kitbdev@gmail.com>2023-11-09 09:11:59 -0500
commitd24d73ba3140b540a017bb230e57d9cde0c3d806 (patch)
tree5bf2b7f8fcb9ea5b6df7ab8f8641987920ad93ef /scene/main/canvas_item.cpp
parent4c96e9676b66d0cc9a25022b019b78f4c20ddc60 (diff)
downloadredot-engine-d24d73ba3140b540a017bb230e57d9cde0c3d806.tar.gz
Make mouse-enter/exit notifications match mouse event propagation
`NOTIFICATION_MOUSE_ENTER` and `NOTIFICATION_MOUSE_EXIT` now includes the areas of children control nodes if the mouse filters allow it. In order to check if a Control node itself was entered/exited, the newly introduced `NOTIFICATION_MOUSE_ENTER_SELF` and `NOTIFICATION_MOUSE_EXIT_SELF` can be used. Co-authored-by: Markus Sauermann <6299227+Sauermann@users.noreply.github.com>
Diffstat (limited to 'scene/main/canvas_item.cpp')
-rw-r--r--scene/main/canvas_item.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/main/canvas_item.cpp b/scene/main/canvas_item.cpp
index a350b97bc8..4ee81e5cb0 100644
--- a/scene/main/canvas_item.cpp
+++ b/scene/main/canvas_item.cpp
@@ -462,6 +462,10 @@ void CanvasItem::set_as_top_level(bool p_top_level) {
_enter_canvas();
_notify_transform();
+
+ if (get_viewport()) {
+ get_viewport()->canvas_item_top_level_changed();
+ }
}
void CanvasItem::_top_level_changed() {