|
@@ -87,7 +87,7 @@
|
|
|
<a
|
|
|
:draggable="true"
|
|
|
@dragstart="onAddShape($event, 'line')"
|
|
|
- @click.stop="onAddShape($event, 'line')"
|
|
|
+ @click="onAddShape($event, 'line')"
|
|
|
><t-icon name="slash"
|
|
|
/></a>
|
|
|
</t-tooltip>
|
|
@@ -95,7 +95,7 @@
|
|
|
<a
|
|
|
:draggable="true"
|
|
|
@dragstart="onAddShape($event, 'text')"
|
|
|
- @click.stop="onAddShape($event, 'text')"
|
|
|
+ @click="onAddShape($event, 'text')"
|
|
|
>T</a
|
|
|
>
|
|
|
</t-tooltip>
|
|
@@ -1091,6 +1091,7 @@ const lineAdd = (pens: Pen[]) => {
|
|
|
};
|
|
|
|
|
|
const onAddShape = (event: DragEvent | MouseEvent, name: string) => {
|
|
|
+ event.stopPropagation();
|
|
|
let data: any;
|
|
|
if (name === 'text') {
|
|
|
data = {
|
|
@@ -1102,11 +1103,11 @@ const onAddShape = (event: DragEvent | MouseEvent, name: string) => {
|
|
|
} else if (name === 'line') {
|
|
|
data = {
|
|
|
anchors: [
|
|
|
- { id: '0', x: 0, y: 0.5 },
|
|
|
- { id: '1', x: 1, y: 0.5 },
|
|
|
+ { id: '0', x: 1, y: 0 },
|
|
|
+ { id: '1', x: 0, y: 1 },
|
|
|
],
|
|
|
width: 100,
|
|
|
- height: 1,
|
|
|
+ height: 100,
|
|
|
name: 'line',
|
|
|
lineName: 'line',
|
|
|
type: 1,
|
|
@@ -1117,7 +1118,6 @@ const onAddShape = (event: DragEvent | MouseEvent, name: string) => {
|
|
|
} else {
|
|
|
(event as DragEvent).dataTransfer?.setData('Meta2d', JSON.stringify(data));
|
|
|
}
|
|
|
- event.stopPropagation();
|
|
|
};
|
|
|
|
|
|
const isLock = ref(0);
|