浏览代码

fix: measure最后一个点显示错误的问题

xzw 2 年之前
父节点
当前提交
c5af0b07e4
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      src/custom/objects/tool/ctrlPolygon.js

+ 6 - 5
src/custom/objects/tool/ctrlPolygon.js

@@ -613,7 +613,7 @@ export class ctrlPolygon extends THREE.Object3D {
             let nextIndex = (index + 1 > lastIndex) ? 0 : index + 1;
             let previousIndex = (index === 0) ? lastIndex : index - 1;
 
-            if(!this.closed && nextIndex == 0  )break; //add
+            
         
             let point = this.points[index];
             let nextPoint = this.points[nextIndex];
@@ -622,15 +622,16 @@ export class ctrlPolygon extends THREE.Object3D {
             if(options.ifUpdateMarkers){
                 this.updateMarker(this.markers[index], point)
             }   
-
+            
+            
+            
+            if(!this.closed && nextIndex == 0  )break; //add
             { // edges
                 let edge = this.edges[index]; 
                 if(edge){
                     LineDraw.updateLine(edge, [point, nextPoint]) 
                     //edge.visible = index < lastIndex || this.isRect || (this.closed && !this.isNew);
-                }
-                
-                
+                } 
             }