bill 1 dzień temu
rodzic
commit
c2225ae3f3

+ 2 - 3
src/core/components/line/renderer/wall/index.vue

@@ -28,14 +28,13 @@
 </template>
 
 <script lang="ts" setup>
-import { computed } from "vue";
+import { computed, watchEffect } from "vue";
 import { useGetDiffLineIconPolygons, useGetExtendPolygon } from "./view";
 import { LineData, LineDataLine } from "../..";
 import { getLinePoints } from "../../attach-server";
 import { flatPositions } from "@/utils/shared";
 import SizeLine from "../../../share/size-line.vue";
 import { useFixedScale } from "@/core/hook/use-viewer";
-
 const props = defineProps<{
   getShapeAttrib: ReturnType<typeof useGetExtendPolygon>;
   data: LineData;
@@ -49,9 +48,9 @@ const props = defineProps<{
 const polygon = computed(() => props.getShapeAttrib(props.line));
 const points = computed(() => getLinePoints(props.data, props.line));
 const gd = useGetDiffLineIconPolygons(props.line, points);
+
 const polygons = computed(() => {
   const result = gd.diff(polygon.value);
-  // console.log(result, polygon.value);
   return result;
 });
 const scale = useFixedScale();

+ 4 - 3
src/core/components/line/renderer/wall/view.ts

@@ -13,9 +13,9 @@ import {
 import { LineData, LineDataLine } from "../..";
 import { getJoinLine, getLinePoints } from "../../attach-server";
 import { MathUtils } from "three";
-import { diffArrayChange, round } from "@/utils/shared";
+import { copy, diffArrayChange, round } from "@/utils/shared";
 import { useStore } from "@/core/store";
-import { computed, nextTick, reactive, Ref, watch } from "vue";
+import { computed, nextTick, reactive, Ref, watch, watchEffect } from "vue";
 import { getLineIconEndpoints } from "../../../line-icon";
 import { useDrawIngData } from "@/core/hook/use-draw";
 import { polygonDifference, polygonDifferenceOnly } from "@/utils/math-clip";
@@ -361,7 +361,7 @@ export const useGetDiffLineIconPolygons = (
 
   const scale = useFixedScale();
   const width = computed(() =>
-    line.fixed ? line.strokeWidth * scale.value : line.strokeWidth
+    (line.fixed ? line.strokeWidth * scale.value : line.strokeWidth) + 10
   );
 
   const interPolygons = computed(() => {
@@ -380,6 +380,7 @@ export const useGetDiffLineIconPolygons = (
 
   return {
     diff: (polygon: Pos[]) => {
+      // console.log('diff', copy(polygon), copy(interPolygons.value))
       const result = interPolygons.value.length
         ? polygonDifference(polygon, interPolygons.value)
         : [polygon];