Bläddra i källkod

Editor: Fix drag&drop in UIOutliner.

Mugen87 5 år sedan
förälder
incheckning
4c5f3ddd9e
1 ändrade filer med 17 tillägg och 2 borttagningar
  1. 17 2
      editor/js/libs/ui.three.js

+ 17 - 2
editor/js/libs/ui.three.js

@@ -522,8 +522,23 @@ UIOutliner.prototype.setOptions = function ( options ) {
 
 		} else if ( area > 0.75 ) {
 
-			var nextObject = scene.getObjectById( this.nextSibling.value );
-			moveObject( object, nextObject.parent, nextObject );
+			var nextObject, parent;
+
+			if ( this.nextSibling !== null ) {
+
+				nextObject = scene.getObjectById( this.nextSibling.value );
+				parent = nextObject.parent;
+
+			} else {
+
+				// end of list (no next object)
+
+				nextObject = null;
+				parent = scene.getObjectById( this.value ).parent;
+
+			}
+
+			moveObject( object, parent, nextObject );
 
 		} else {