|
@@ -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,
|