فهرست منبع

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 } );
 
 	},