소스 검색

Last spline coordinates not stored in actions (#8878)

In the actions array of the Path, the last elements of the args array
need to be the x and y of the last point of the segment added to the
path.
Not the case with splineThru => cause an exception if you add an other
segment after the pline (without a moveTo).
Used the same trick as absellipse does.
rfm1201 9 년 전
부모
커밋
6e4e8998a6
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/extras/core/Path.js

+ 4 - 0
src/extras/core/Path.js

@@ -113,6 +113,10 @@ THREE.Path.prototype = Object.assign( Object.create( THREE.CurvePath.prototype )
 		var curve = new THREE.SplineCurve( npts );
 		this.curves.push( curve );
 
+		var lastPoint = pts[ pts.length - 1 ];
+		args.push( lastPoint.x );
+		args.push( lastPoint.y );
+
 		this.actions.push( { action: 'splineThru', args: args } );
 
 	},