mirror of
https://github.com/tiennm99/godot.git
synced 2026-08-06 04:23:34 +00:00
Fix Viewport root order after Node2D raise
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
|
||||
#include "node_2d.h"
|
||||
|
||||
#include "scene/main/viewport.h"
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
Dictionary Node2D::_edit_get_state() const {
|
||||
Dictionary state;
|
||||
@@ -389,6 +391,16 @@ bool Node2D::is_y_sort_enabled() const {
|
||||
return y_sort_enabled;
|
||||
}
|
||||
|
||||
void Node2D::_notification(int p_notification) {
|
||||
switch (p_notification) {
|
||||
case NOTIFICATION_MOVED_IN_PARENT: {
|
||||
if (get_viewport()) {
|
||||
get_viewport()->gui_set_root_order_dirty();
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
void Node2D::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_position", "position"), &Node2D::set_position);
|
||||
ClassDB::bind_method(D_METHOD("set_rotation", "radians"), &Node2D::set_rotation);
|
||||
|
||||
Reference in New Issue
Block a user