|
@@ -601,7 +601,22 @@ if (hasMarkResultToRender) {
|
|
|
//#endregion : 显示评分状态和清除轨迹
|
|
|
|
|
|
//#region : 评分
|
|
|
+const checkTrackValid = (event: MouseEvent) => {
|
|
|
+ const { clientWidth, clientHeight, naturalWidth, naturalHeight } =
|
|
|
+ event.target;
|
|
|
+ const { offsetX, offsetY } = event;
|
|
|
+ const xLimitRate = 10 / naturalWidth;
|
|
|
+ const yLimitRate = 10 / naturalHeight;
|
|
|
+ return (
|
|
|
+ offsetX / clientWidth >= xLimitRate && offsetY / clientHeight >= yLimitRate
|
|
|
+ );
|
|
|
+};
|
|
|
const innerMakeTrack = (event: MouseEvent, item: SliceImage) => {
|
|
|
+ if (!checkTrackValid(event)) {
|
|
|
+ void message.warn("轨迹位置距离边界太近");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
clearEmptySpecialTag(item);
|
|
|
makeTrack(event, item, maxSliceWidth, theFinalHeight);
|
|
|
};
|