完成1倍靶纸压线就算环数
This commit is contained in:
@@ -60,7 +60,6 @@ const onClick = async (e) => {
|
||||
props.id,
|
||||
newArrow.x / scale.value - rect.value.width * 0.05,
|
||||
newArrow.y / scale.value - rect.value.width * 0.05,
|
||||
rect.value.width * 0.9,
|
||||
rect.value.width * 0.9
|
||||
);
|
||||
arrow.value = {
|
||||
@@ -116,7 +115,6 @@ const onDrag = async (e) => {
|
||||
const deltaX = clientX - dragStartPos.value.x;
|
||||
const deltaY = clientY - dragStartPos.value.y;
|
||||
const side = rect.value.width;
|
||||
|
||||
// 更新坐标
|
||||
arrow.value.x = Math.max(
|
||||
0,
|
||||
@@ -126,12 +124,10 @@ const onDrag = async (e) => {
|
||||
0,
|
||||
Math.min(side * scale.value, arrow.value.y * side + deltaY)
|
||||
);
|
||||
|
||||
arrow.value.ring = calcRing(
|
||||
props.id,
|
||||
arrow.value.x / scale.value - rect.value.width * 0.05,
|
||||
arrow.value.y / scale.value - rect.value.width * 0.05,
|
||||
rect.value.width * 0.9,
|
||||
rect.value.width * 0.9
|
||||
);
|
||||
|
||||
|
||||
@@ -97,6 +97,21 @@ const loadConfig = () => {
|
||||
} else if (props.itemIndex === 2) {
|
||||
data.value = config.targetOption;
|
||||
}
|
||||
if (props.value) {
|
||||
if (props.itemIndex === 0 || props.itemIndex === 2) {
|
||||
selectedIndex.value = data.value.findIndex(
|
||||
(item) => item.name === props.value
|
||||
);
|
||||
}
|
||||
if (props.itemIndex === 1) {
|
||||
selectedIndex.value = distances.findIndex(
|
||||
(item) => item.name === props.value
|
||||
);
|
||||
if (selectedIndex.value === -1) {
|
||||
selectedIndex.value = 9;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
onMounted(async () => {
|
||||
|
||||
Reference in New Issue
Block a user