Create a virtual mouse move event after moving child nodes

This updates mouse cursor and mouse-over-states without the need
for additional mouse movements.
This commit is contained in:
Markus Sauermann
2022-09-29 23:45:51 +02:00
parent 72f7131be1
commit ce10ca6979
8 changed files with 37 additions and 7 deletions
+8
View File
@@ -216,6 +216,14 @@ void Node::_notification(int p_notification) {
memdelete(child);
}
} break;
case NOTIFICATION_CHILD_ORDER_CHANGED: {
// The order, in which canvas items are drawn gets rearranged.
// This makes it necessary to update mouse cursor and send according mouse_enter/mouse_exit signals for Control nodes.
if (get_viewport()) {
get_viewport()->update_mouse_cursor_state();
}
} break;
}
}