|
@@ -414,8 +414,8 @@ const elementMarking = (item) => {
|
|
|
if (item.imgStatus) {
|
|
|
w = Number(Math.round(item.w));
|
|
|
h = Number(Math.round(item.h));
|
|
|
- elLength.value = Number(Math.round(item.w / 5));
|
|
|
- elWidth.value = Number(Math.round(item.h / 5));
|
|
|
+ elLength.value = Number(Math.round(item.w / 4));
|
|
|
+ elWidth.value = Number(Math.round(item.h / 4));
|
|
|
x1 = x;
|
|
|
y1 = y;
|
|
|
x3 = x;
|
|
@@ -426,8 +426,8 @@ const elementMarking = (item) => {
|
|
|
let textPixel = getStringPixel(item.text, item.size + "px 宋体");
|
|
|
w = Number(Math.round(textPixel.width));
|
|
|
h = Number(Math.round(textPixel.fontBoundingBoxAscent + textPixel.fontBoundingBoxDescent));
|
|
|
- elLength.value = Number(Math.round(textPixel.width / 5));
|
|
|
- elWidth.value = Number(Math.round((textPixel.fontBoundingBoxAscent + textPixel.fontBoundingBoxDescent) / 5));
|
|
|
+ elLength.value = Number(Math.round(textPixel.width / 4));
|
|
|
+ elWidth.value = Number(Math.round((textPixel.fontBoundingBoxAscent + textPixel.fontBoundingBoxDescent) / 4));
|
|
|
x1 = x;
|
|
|
y1 = y - h;
|
|
|
x3 = x;
|
|
@@ -447,29 +447,29 @@ const elementMarking = (item) => {
|
|
|
if (y1_rotated < y3_rotated) {
|
|
|
elCoordinates.value.push({ textStatus: false, x1: 0, y1: y1_rotated, x2: x1_rotated, y2: y1_rotated });
|
|
|
elCoordinates.value.push({ textStatus: false, x1: x1_rotated, y1: 0, x2: x1_rotated, y2: y1_rotated });
|
|
|
- elCoordinates.value.push({ textStatus: true, x: x1_rotated / 2, y: y1_rotated + 30, color: "red", text: Number(Math.round(x1_rotated / 5)) + "mm" });
|
|
|
- elCoordinates.value.push({ textStatus: true, x: x1_rotated + 10, y: y1_rotated / 2, color: "red", text: Number(Math.round(y1_rotated / 5)) + "mm" });
|
|
|
+ elCoordinates.value.push({ textStatus: true, x: x1_rotated / 2, y: y1_rotated + 30, color: "red", text: Number(Math.round(x1_rotated / 4)) + "mm" });
|
|
|
+ elCoordinates.value.push({ textStatus: true, x: x1_rotated + 10, y: y1_rotated / 2, color: "red", text: Number(Math.round(y1_rotated / 4)) + "mm" });
|
|
|
} else {
|
|
|
elCoordinates.value.push({ textStatus: false, x1: 0, y1: y3_rotated, x2: x3_rotated, y2: y3_rotated });
|
|
|
elCoordinates.value.push({ textStatus: false, x1: x3_rotated, y1: 0, x2: x3_rotated, y2: y3_rotated });
|
|
|
- elCoordinates.value.push({ textStatus: true, x: x3_rotated / 2, y: y3_rotated + 30, color: "red", text: Number(Math.round(x3_rotated / 5)) + "mm" });
|
|
|
- elCoordinates.value.push({ textStatus: true, x: x3_rotated + 10, y: y3_rotated / 2, color: "red", text: Number(Math.round(y3_rotated / 5)) + "mm" });
|
|
|
+ elCoordinates.value.push({ textStatus: true, x: x3_rotated / 2, y: y3_rotated + 30, color: "red", text: Number(Math.round(x3_rotated / 4)) + "mm" });
|
|
|
+ elCoordinates.value.push({ textStatus: true, x: x3_rotated + 10, y: y3_rotated / 2, color: "red", text: Number(Math.round(y3_rotated / 4)) + "mm" });
|
|
|
}
|
|
|
} else if (x1_rotated > x3_rotated) {
|
|
|
elCoordinates.value.push({ textStatus: false, x1: 0, y1: y3_rotated, x2: x3_rotated, y2: y3_rotated });
|
|
|
elCoordinates.value.push({ textStatus: false, x1: x3_rotated, y1: 0, x2: x3_rotated, y2: y3_rotated });
|
|
|
- elCoordinates.value.push({ textStatus: true, x: x3_rotated / 2, y: y3_rotated + 30, color: "red", text: Number(Math.round(x3_rotated / 5)) + "mm" });
|
|
|
- elCoordinates.value.push({ textStatus: true, x: x3_rotated + 10, y: y3_rotated / 2, color: "red", text: Number(Math.round(y3_rotated / 5)) + "mm" });
|
|
|
+ elCoordinates.value.push({ textStatus: true, x: x3_rotated / 2, y: y3_rotated + 30, color: "red", text: Number(Math.round(x3_rotated / 4)) + "mm" });
|
|
|
+ elCoordinates.value.push({ textStatus: true, x: x3_rotated + 10, y: y3_rotated / 2, color: "red", text: Number(Math.round(y3_rotated / 4)) + "mm" });
|
|
|
} else {
|
|
|
elCoordinates.value.push({ textStatus: false, x1: 0, y1: y1_rotated, x2: x1_rotated, y2: y1_rotated });
|
|
|
elCoordinates.value.push({ textStatus: false, x1: x1_rotated, y1: 0, x2: x1_rotated, y2: y1_rotated });
|
|
|
- elCoordinates.value.push({ textStatus: true, x: x1_rotated / 2, y: y1_rotated + 30, color: "red", text: Number(Math.round(x1_rotated / 5)) + "mm" });
|
|
|
- elCoordinates.value.push({ textStatus: true, x: x1_rotated + 10, y: y1_rotated / 2, color: "red", text: Number(Math.round(y1_rotated / 5)) + "mm" });
|
|
|
+ elCoordinates.value.push({ textStatus: true, x: x1_rotated / 2, y: y1_rotated + 30, color: "red", text: Number(Math.round(x1_rotated / 4)) + "mm" });
|
|
|
+ elCoordinates.value.push({ textStatus: true, x: x1_rotated + 10, y: y1_rotated / 2, color: "red", text: Number(Math.round(y1_rotated / 4)) + "mm" });
|
|
|
}
|
|
|
};
|
|
|
const clickToView = () => {
|
|
|
- width.value = Number(Math.round(formData.data.width * 5));
|
|
|
- height.value = Number(Math.round(formData.data.length * 5));
|
|
|
+ width.value = Number(Math.round(formData.data.width * 4));
|
|
|
+ height.value = Number(Math.round(formData.data.length * 4));
|
|
|
openDrawing.value = true;
|
|
|
nextTick(() => {
|
|
|
init();
|