bill 2 месяцев назад
Родитель
Сommit
9655776f5f

+ 2 - 2
public/icons/yandao.svg

@@ -1,5 +1,5 @@
 <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M2.5 2.5H29.5V29.5H2.5V2.5Z" stroke="black"/>
+<path d="M4.5 4.5H27.5V27.5H4.50001L4.5 4.5Z" stroke="black"/>
 <path d="M4.5 4.5L22.5 9.5L27.5 27.5" stroke="black"/>
-<path d="M2.5 2.5L29.5 2.5V29.5H2.5V2.5Z" stroke="black"/>
-<path d="M4.5 4.5H27.5L27.5 27.5H4.50001L4.5 4.5Z" stroke="black"/>
 </svg>

+ 1 - 1
public/icons/zhuzi.svg

@@ -1,5 +1,5 @@
 <svg width="32" height="32" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M2.5 2.5H29.5V29.5H2.5V2.5Z" stroke="black"/>
 <path d="M2.5 2.5L29.5 29.5" stroke="black"/>
 <path d="M29.5 2.5L2.5 29.5" stroke="black"/>
-<path d="M2.5 2.5L29.5 2.5V29.5H2.5V2.5Z" stroke="black"/>
 </svg>

+ 6 - 2
src/core/components/line/attach-view.ts

@@ -85,7 +85,6 @@ export const extendLinesOverlap = (
           if (has(key)) continue;
           set(key);
           watchEffect((onCleanup) => {
-            console.log(points.value)
             const polygons = getExtendPolygons(
               { ...line1, points: points.value },
               joinLines[j]
@@ -102,8 +101,13 @@ export const extendLinesOverlap = (
     );
   };
 
+  watchEffect((onCleanup) => {
+    console.log(data.lines.indexOf(line1))
+    onCleanup(() => 'has?')
+  })
+
   const stopWatch = watch(
-    () => (line1.a + line1.b + data.lines.includes(line1) ? "exixts" : ""),
+    () => [line1, line1.a, line1.b],
     () => {
       if (!data.lines.includes(line1)) {
         return stopWatch();

+ 1 - 1
src/core/components/line/line.vue

@@ -1,5 +1,5 @@
 <template>
-  <TempLine :data="data" @updateShape="emit('updateShape', { ...data })" />
+  <TempLine :data="data" @updateShape="emit('updateShape', data)" />
 </template>
 
 <script lang="ts" setup>

+ 1 - 1
src/core/components/line/single-line.vue

@@ -69,7 +69,7 @@
 </template>
 
 <script lang="ts" setup>
-import { computed, ref } from "vue";
+import { computed, ref, watchEffect } from "vue";
 import { getMouseStyle, getSnapInfos, LineData, shapeName } from "./index.ts";
 import { flatPositions, onlyId } from "@/utils/shared.ts";
 import EditLine from "../share/edit-line.vue";