|
|
@@ -47,15 +47,21 @@
|
|
|
>
|
|
|
<Point
|
|
|
v-for="(_, ndx) in data.points"
|
|
|
- :size="data.strokeWidth + (data.fixed ? 6 * scale : 6)"
|
|
|
+ :size="Math.max(props.data.strokeWidth || 10, 10)"
|
|
|
:points="data.points"
|
|
|
+ :fixed="props.data.fixed"
|
|
|
:ndx="ndx"
|
|
|
:closed="false"
|
|
|
:id="data.id"
|
|
|
:disable="addMode"
|
|
|
:color="data.fill"
|
|
|
@update:position="(p) => emit('update:position', { ndx, val: p })"
|
|
|
- @dragend="emit('update')"
|
|
|
+ @dragend="
|
|
|
+ () =>
|
|
|
+ zeroEq(lineLen(data.points[0], data.points[1]))
|
|
|
+ ? emit('delete')
|
|
|
+ : emit('update')
|
|
|
+ "
|
|
|
notDelete
|
|
|
/>
|
|
|
</template>
|
|
|
@@ -86,12 +92,13 @@ import { Group } from "konva/lib/Group";
|
|
|
import { useConfig } from "@/core/hook/use-config.ts";
|
|
|
import { useMouseShapeStatus } from "@/core/hook/use-mouse-status.ts";
|
|
|
import { useOperMode } from "@/core/hook/use-status.ts";
|
|
|
-import { useFixedScale, useViewerInvertTransformConfig } from "@/core/hook/use-viewer.ts";
|
|
|
+import { useFixedScale } from "@/core/hook/use-viewer.ts";
|
|
|
|
|
|
const props = defineProps<{ data: ArrowData; canEdit?: boolean; addMode?: boolean }>();
|
|
|
const emit = defineEmits<{
|
|
|
(e: "update:position", data: { ndx: number; val: Pos }): void;
|
|
|
(e: "update"): void;
|
|
|
+ (e: "delete"): void;
|
|
|
(e: "deletePoint", ndx: number): void;
|
|
|
(e: "addPoint", data: { ndx: number; val: Pos }): void;
|
|
|
}>();
|
|
|
@@ -111,6 +118,7 @@ const data = computed(() => {
|
|
|
style.strokeWidth = props.data.fixed
|
|
|
? style.strokeWidth * scale.value
|
|
|
: style.strokeWidth;
|
|
|
+ console;
|
|
|
return style;
|
|
|
});
|
|
|
const hitFunc: LineConfig["hitFunc"] = (con, shape) => {
|