|
@@ -36,6 +36,7 @@
|
|
|
:dx="item.dx"
|
|
|
:dy="item.dy"
|
|
|
@deleteSpecialtag="(tag) => deleteSpecialtag(item, tag)"
|
|
|
+ @click-specialtag="(event) => clickSpecialtag(event, item)"
|
|
|
/>
|
|
|
<div
|
|
|
v-if="isCustomSpecialTag"
|
|
@@ -474,6 +475,16 @@ const deleteSpecialtag = (item, tag) => {
|
|
|
if (stagIndex === -1) return;
|
|
|
store.currentTaskEnsured.markResult.specialTagList.splice(tagIndex, 1);
|
|
|
};
|
|
|
+const clickSpecialtag = (event: MouseEvent, item: SliceImage) => {
|
|
|
+ // console.log(event);
|
|
|
+ const e = {
|
|
|
+ target: event.target.offsetParent.childNodes[0],
|
|
|
+ offsetX: event.offsetX + event.target.offsetLeft,
|
|
|
+ offsetY: event.offsetY + event.target.offsetTop,
|
|
|
+ };
|
|
|
+
|
|
|
+ makeTrack(e as MouseEvent, item, maxSliceWidth, theFinalHeight);
|
|
|
+};
|
|
|
|
|
|
const clearEmptySpecialTag = (item) => {
|
|
|
item.tagList
|
|
@@ -661,6 +672,8 @@ let curImageTarget: HTMLElement = null;
|
|
|
let curSliceImagesWithTrackItem: SliceImage = $ref(null);
|
|
|
|
|
|
const specialLenStyle = $computed(() => {
|
|
|
+ if (specialPoint.ex <= specialPoint.x) return { display: "none" };
|
|
|
+
|
|
|
const width =
|
|
|
specialPoint.ex > specialPoint.x ? specialPoint.ex - specialPoint.x : 0;
|
|
|
return {
|
|
@@ -673,6 +686,9 @@ const specialLenStyle = $computed(() => {
|
|
|
};
|
|
|
});
|
|
|
const specialCircleStyle = $computed(() => {
|
|
|
+ if (specialPoint.ex <= specialPoint.x || specialPoint.ey <= specialPoint.y)
|
|
|
+ return { display: "none" };
|
|
|
+
|
|
|
const width =
|
|
|
specialPoint.ex > specialPoint.x ? specialPoint.ex - specialPoint.x : 0;
|
|
|
const height =
|
|
@@ -700,6 +716,19 @@ function specialMouseMove({ left, top }) {
|
|
|
specialPoint.ey = top + specialPoint.y;
|
|
|
}
|
|
|
function specialMouseStop(e: MouseEvent) {
|
|
|
+ if (
|
|
|
+ store.currentSpecialTagType === "LINE" &&
|
|
|
+ specialPoint.ex <= specialPoint.x
|
|
|
+ ) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ store.currentSpecialTagType === "CIRCLE" &&
|
|
|
+ (specialPoint.ex <= specialPoint.x || specialPoint.ey <= specialPoint.y)
|
|
|
+ ) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
const track: SpecialTag = {
|
|
|
tagName: "",
|
|
|
tagType: store.currentSpecialTagType,
|