瀏覽代碼

Merge pull request #18628 from Mugen87/dev11

KeyframeTrack: Clarify if-clause in .trim().
Mr.doob 5 年之前
父節點
當前提交
bef4ad17e1
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      src/animation/KeyframeTrack.js

+ 6 - 1
src/animation/KeyframeTrack.js

@@ -254,7 +254,12 @@ Object.assign( KeyframeTrack.prototype, {
 		if ( from !== 0 || to !== nKeys ) {
 
 			// empty tracks are forbidden, so keep at least one keyframe
-			if ( from >= to ) to = Math.max( to, 1 ), from = to - 1;
+			if ( from >= to ) {
+
+				to = Math.max( to, 1 );
+				from = to - 1;
+
+			}
 
 			var stride = this.getValueSize();
 			this.times = AnimationUtils.arraySlice( times, from, to );