bill 11 月之前
父節點
當前提交
67535f5401
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/board/packages/whole-line/service/whole-line-edit.ts

+ 4 - 2
src/board/packages/whole-line/service/whole-line-edit.ts

@@ -148,6 +148,7 @@ export const penWholeLinePoygonsEdit = <
     let child = target && tree.find(target.id());
     const pixel = [evt.evt.offsetX, evt.evt.offsetY];
 
+    console.log(child);
     if (child instanceof WholeLineLine) {
       if (!canOper || canOper(child, evt.target)) {
         if (polyginAttrib.lineIds.includes(child.attrib.id)) {
@@ -193,6 +194,7 @@ export const penWholeLinePoygonsEdit = <
             radius: adsorbRadius,
             points: [...points].reverse(),
           });
+          console.log(position);
         } else {
           position = tree.getRealFromStage(pixel);
         }
@@ -203,8 +205,8 @@ export const penWholeLinePoygonsEdit = <
           if (flatChildren[i] instanceof WholeLinePoint) {
             const point = flatChildren[i] as WholeLinePoint;
             if (
-              round(point.attrib.x - position[0], 4) === 0 &&
-              round(point.attrib.y - position[1], 4) === 0
+              round(point.attrib.x - position[0], 8) === 0 &&
+              round(point.attrib.y - position[1], 8) === 0
             ) {
               child = tree.children[i];
               break;