|
@@ -510,10 +510,10 @@ export default {
|
|
|
this.is_mark = 1
|
|
this.is_mark = 1
|
|
|
const { startX, startY,text } = item;
|
|
const { startX, startY,text } = item;
|
|
|
// 使用缩放比例计算标记位置和尺寸
|
|
// 使用缩放比例计算标记位置和尺寸
|
|
|
- const x = (startX * scaleRatio / this.imageWidth) * 105;
|
|
|
|
|
- const y = (startY * scaleRatio / this.imageHeight) * 105;
|
|
|
|
|
- const width = (item.width * scaleRatio / this.imageWidth) * 100;
|
|
|
|
|
- const height = (item.height * scaleRatio / this.imageHeight) * 100;
|
|
|
|
|
|
|
+ const x = item.width > 0 ? (startX * scaleRatio / this.imageWidth) * 105 : ((startX + item.width) * scaleRatio / this.imageWidth) * 105;
|
|
|
|
|
+ const y = item.height > 0 ? (startY * scaleRatio / this.imageHeight) * 105 : ((startY + item.height) * scaleRatio / this.imageHeight) * 105;
|
|
|
|
|
+ const width = (item.width > 0 ? item.width : -item.width) * scaleRatio / this.imageWidth * 100;
|
|
|
|
|
+ const height = (item.height > 0 ? item.height : -item.height) * scaleRatio / this.imageHeight * 100;
|
|
|
|
|
|
|
|
// 从字典中获取虫子名字(尝试字符串和数字两种类型)
|
|
// 从字典中获取虫子名字(尝试字符串和数字两种类型)
|
|
|
const pestName = text;
|
|
const pestName = text;
|