Browse Source

feat: 调试

zhangjie 2 weeks ago
parent
commit
3b818f03e2
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/features/mark/composables/useMakeTrack.ts

+ 3 - 3
src/features/mark/composables/useMakeTrack.ts

@@ -163,11 +163,11 @@ export default function useMakeTrack() {
     }
     }
   }
   }
 
 
-  function getRandomPosition(area: SplitConfig) {
+  function getRandomPosition(area: SplitConfig, yCenter = false) {
     const { x, y, w, h } = area;
     const { x, y, w, h } = area;
     return {
     return {
       x: x + w / 4 + (Math.random() * w) / 2,
       x: x + w / 4 + (Math.random() * w) / 2,
-      y: y + h / 4 + (Math.random() * h) / 2,
+      y: yCenter ? y + h / 2 : y + h / 4 + (Math.random() * h) / 2,
     };
     };
   }
   }
 
 
@@ -241,7 +241,7 @@ export default function useMakeTrack() {
     if (!imageSize) return;
     if (!imageSize) return;
 
 
     // 不存在时,在第一个评卷区的中心50%的区域随机一个点
     // 不存在时,在第一个评卷区的中心50%的区域随机一个点
-    const { x, y } = getRandomPosition(area);
+    const { x, y } = getRandomPosition(area, true);
     const track: Track = {
     const track: Track = {
       id: getTrackId({
       id: getTrackId({
         mainNumber: question.mainNumber,
         mainNumber: question.mainNumber,