Explorar o código

AnimationObjectGroup: Fix uncache() when used with a single object.

Mugen87 %!s(int64=4) %!d(string=hai) anos
pai
achega
8295b0ea5f
Modificáronse 1 ficheiros con 6 adicións e 1 borrados
  1. 6 1
      src/animation/AnimationObjectGroup.js

+ 6 - 1
src/animation/AnimationObjectGroup.js

@@ -281,7 +281,12 @@ Object.assign( AnimationObjectGroup.prototype, {
 					const lastIndex = -- nObjects,
 						lastObject = objects[ lastIndex ];
 
-					indicesByUUID[ lastObject.uuid ] = index;
+					if ( lastIndex > 0 ) {
+
+						indicesByUUID[ lastObject.uuid ] = index;
+
+					}
+
 					objects[ index ] = lastObject;
 					objects.pop();