浏览代码

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

* fix #26849

* Update CurvePath.js

---------

Co-authored-by: Michael Herzog <[email protected]>
郭斌勇 2 年之前
父节点
当前提交
5c004571e9
共有 1 个文件被更改,包括 2 次插入1 次删除
  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 ) );
 
 		}