Browse Source

CurvePath: Use correct line type in `closePath()`. (#26850)

* fix #26849

* Update CurvePath.js

---------

Co-authored-by: Michael Herzog <[email protected]>
郭斌勇 1 year ago
parent
commit
5c004571e9
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/extras/core/CurvePath.js

+ 2 - 1
src/extras/core/CurvePath.js

@@ -33,7 +33,8 @@ class CurvePath extends Curve {
 
 		if ( ! startPoint.equals( endPoint ) ) {
 
-			this.curves.push( new Curves[ 'LineCurve' ]( endPoint, startPoint ) );
+			const lineType = ( startPoint.isVector2 === true ) ? 'LineCurve' : 'LineCurve3';
+			this.curves.push( new Curves[ lineType ]( endPoint, startPoint ) );
 
 		}