diff options
| author | Juan Linietsky | 2016-10-03 16:33:42 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-10-03 21:35:16 +0200 |
| commit | 22d83bc9f655d5ae7a1b49709c4c1b663725daf5 (patch) | |
| tree | a817195c08d4713a70ca014a3f63f5937934fe36 /scene/main/node.cpp | |
| parent | 78d97b060a6873a454e710380cb9ef1bde5e4c65 (diff) | |
| download | godot-22d83bc9f655d5ae7a1b49709c4c1b663725daf5.tar.gz godot-22d83bc9f655d5ae7a1b49709c4c1b663725daf5.tar.zst godot-22d83bc9f655d5ae7a1b49709c4c1b663725daf5.zip | |
Begining of GLES3 renderer:
-Most 2D drawing is implemented
-Missing shaders
-Missing all 3D
-Editor needs to be set on update always to be used, otherwise it does not refresh
-Large parts of editor not working
Diffstat (limited to 'scene/main/node.cpp')
| -rw-r--r-- | scene/main/node.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 189224042..5d4e46f9a 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -315,6 +315,12 @@ void Node::move_child(Node *p_child,int p_pos) { } + if (p_child->data.pos==p_pos) + return; //do nothing + + int motion_from = MIN(p_pos,p_child->data.pos); + int motion_to = MAX(p_pos,p_child->data.pos); + data.children.remove( p_child->data.pos ); data.children.insert( p_pos, p_child ); @@ -324,13 +330,13 @@ void Node::move_child(Node *p_child,int p_pos) { data.blocked++; //new pos first - for (int i=0;i<data.children.size();i++) { + for (int i=motion_from;i<=motion_to;i++) { data.children[i]->data.pos=i; } // notification second move_child_notify(p_child); - for (int i=0;i<data.children.size();i++) { + for (int i=motion_from;i<=motion_to;i++) { data.children[i]->notification( NOTIFICATION_MOVED_IN_PARENT ); } |
