|
@@ -30,6 +30,7 @@
|
|
|
import type { SpecialTag, Track } from "@/types";
|
|
|
import { toRefs, watch } from "vue";
|
|
|
import { store } from "@/store/store";
|
|
|
+import { message } from "ant-design-vue";
|
|
|
|
|
|
const props = defineProps<{
|
|
|
trackList: Array<Track>;
|
|
@@ -44,9 +45,20 @@ const { trackList } = toRefs(props);
|
|
|
const computeTopAndLeft = (track: Track | SpecialTag) => {
|
|
|
const topInsideSlice = track.offsetY - props.dy;
|
|
|
const leftInsideSlice = track.offsetX - props.dx;
|
|
|
+ const topInsideSliceRatio = topInsideSlice / props.sliceImageHeight;
|
|
|
+ const leftInsideSliceRatio = leftInsideSlice / props.sliceImageWidth;
|
|
|
+ if (
|
|
|
+ topInsideSliceRatio < 0 ||
|
|
|
+ topInsideSliceRatio > 1 ||
|
|
|
+ leftInsideSliceRatio < 0 ||
|
|
|
+ leftInsideSliceRatio > 1
|
|
|
+ ) {
|
|
|
+ void message.error("轨迹坐标有误,可能是图片被修改过,请联系管理员!");
|
|
|
+ }
|
|
|
+
|
|
|
return {
|
|
|
- top: (topInsideSlice / props.sliceImageHeight) * 100 + "%",
|
|
|
- left: (leftInsideSlice / props.sliceImageWidth) * 100 + "%",
|
|
|
+ top: topInsideSliceRatio * 100 + "%",
|
|
|
+ left: leftInsideSliceRatio * 100 + "%",
|
|
|
"font-size":
|
|
|
(store.setting.uiSetting["score.fontSize.scale"] || 1) *
|
|
|
store.setting.uiSetting["answer.paper.scale"] *
|