|
@@ -11,6 +11,7 @@ import SVGIcons from "../CanvasStyle/ImageLabels/SVGIcons";
|
|
|
import VectorStyle from "@/graphic/enum/VectorStyle.js";
|
|
|
import VectorWeight from "@/graphic/enum/VectorWeight.js";
|
|
|
import router from "@/router/index";
|
|
|
+import VectorType from "../enum/VectorType.js";
|
|
|
|
|
|
const isScreenStyle = () =>
|
|
|
Settings.screenMode && router.currentRoute.value.params.mode === "0";
|
|
@@ -424,6 +425,7 @@ export const help = {
|
|
|
ctx.stroke();
|
|
|
ctx.closePath();
|
|
|
ctx.restore();
|
|
|
+
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -659,13 +661,29 @@ export default class Draw {
|
|
|
}
|
|
|
|
|
|
// console.log(edgeVector);
|
|
|
- edgeVector.style = VectorStyle.SingleSolidLine;
|
|
|
+ // edgeVector.style = VectorStyle.SingleSolidLine;
|
|
|
help.drawStyleLine(
|
|
|
ctx,
|
|
|
points,
|
|
|
edgeVector.roadSide ? VectorStyle.RoadSide : edgeVector.style,
|
|
|
edgeVector.roadSide ? edgeVector.roadSide.width : edgeVector.weight
|
|
|
);
|
|
|
+
|
|
|
+ if (edgeVector.roadSide) {
|
|
|
+ console.log(edgeVector);
|
|
|
+ help.drawLineText(
|
|
|
+ ctx,
|
|
|
+ points[2],
|
|
|
+ points[3],
|
|
|
+ edgeVector.roadSide.width * 10,
|
|
|
+ {
|
|
|
+ fillColor: isScreenStyle() ? "#000" : "#fff",
|
|
|
+ padding: 6,
|
|
|
+ fontSize: 12,
|
|
|
+ backColor: style.strokeStyle,
|
|
|
+ }
|
|
|
+ );
|
|
|
+ }
|
|
|
}
|
|
|
if (import.meta.env.DEV) {
|
|
|
this.drawTextByInfo(
|
|
@@ -763,7 +781,7 @@ export default class Draw {
|
|
|
ctx.save();
|
|
|
help.setVectorStyle(ctx, vector);
|
|
|
ctx.beginPath();
|
|
|
- if (!isScreenStyle()) {
|
|
|
+ if (!Settings.screenMode) {
|
|
|
ctx.arc(
|
|
|
extremePoint.x,
|
|
|
extremePoint.y,
|
|
@@ -951,7 +969,7 @@ export default class Draw {
|
|
|
|
|
|
ctx.save();
|
|
|
for (let [start, end] of dires) {
|
|
|
- const lines = mathUtil.getArrow(start, end, len);
|
|
|
+ const lines = mathUtil.getArrow(start, end, 30, len);
|
|
|
ctx.moveTo(lines[0].x, lines[0].y);
|
|
|
ctx.lineTo(lines[1].x, lines[1].y);
|
|
|
ctx.lineTo(lines[2].x, lines[2].y);
|
|
@@ -973,7 +991,11 @@ export default class Draw {
|
|
|
if (vector.color) {
|
|
|
ctx.strokeStyle = vector.color;
|
|
|
}
|
|
|
- this.drawLineArrow([start, end], vector.category === UIEvents.DoubleArrow);
|
|
|
+ this.drawLineArrow(
|
|
|
+ [start, end],
|
|
|
+ vector.category === UIEvents.DoubleArrow,
|
|
|
+ 40
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
drawMagnifier(vector) {
|
|
@@ -1121,7 +1143,7 @@ export default class Draw {
|
|
|
const screenNotDrawTypes = [VectorCategory.Point.NormalPoint];
|
|
|
if (!screenSave) {
|
|
|
if (
|
|
|
- (isScreenStyle() &&
|
|
|
+ (Settings.screenMode &&
|
|
|
(!vector.category || screenNotDrawTypes.includes(vector.category))) ||
|
|
|
vector.category === VectorCategory.Point.TestBasePoint
|
|
|
) {
|
|
@@ -1144,6 +1166,7 @@ export default class Draw {
|
|
|
ctx.restore();
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
if (line.category !== "ZebraCrossing") {
|
|
|
const [stylea, attr] = help.getVectorStyle(line, line.category);
|
|
|
style = {
|
|
@@ -1152,6 +1175,19 @@ export default class Draw {
|
|
|
fillStyle: attr ? "#fff" : stylea.strokeStyle,
|
|
|
};
|
|
|
}
|
|
|
+ if (
|
|
|
+ line &&
|
|
|
+ [VectorType.SingleArrowLine, VectorType.DoubleArrowLine].includes(
|
|
|
+ line.category
|
|
|
+ ) &&
|
|
|
+ line.color
|
|
|
+ ) {
|
|
|
+ style = {
|
|
|
+ ...style,
|
|
|
+ fillStyle: line.color,
|
|
|
+ strokeStyle: line.color,
|
|
|
+ };
|
|
|
+ }
|
|
|
} else if (vector.category === VectorCategory.Point.FixPoint) {
|
|
|
const text = dataService.getText(vector?.linkedTextId);
|
|
|
if (text) {
|
|
@@ -1407,7 +1443,7 @@ export default class Draw {
|
|
|
coordinate.getScreenXY(startReal),
|
|
|
coordinate.getScreenXY(endReal),
|
|
|
vector.value
|
|
|
- ? Math.round(vector.value * 100) / 100
|
|
|
+ ? Math.round(vector.value * 1000)
|
|
|
: help.getRealDistance(startReal, endReal),
|
|
|
style
|
|
|
);
|
|
@@ -1502,7 +1538,15 @@ export default class Draw {
|
|
|
this.context.setLineDash(style.dash);
|
|
|
}
|
|
|
|
|
|
- console.log(vector);
|
|
|
+ if (
|
|
|
+ [VectorType.SingleArrowLine, VectorType.DoubleArrowLine].includes(
|
|
|
+ vector.category
|
|
|
+ ) &&
|
|
|
+ vector.color
|
|
|
+ ) {
|
|
|
+ this.context.strokeStyle = vector.color;
|
|
|
+ }
|
|
|
+ console.log(vector.style);
|
|
|
help.drawStyleLine(this.context, [start, end], vector.style, vector.weight);
|
|
|
// vector.category = VectorCategory.Line.LocationLineByFixPoint;
|
|
|
switch (vector.category) {
|
|
@@ -1520,6 +1564,7 @@ export default class Draw {
|
|
|
case VectorCategory.Line.FreeMeasureLine:
|
|
|
case VectorCategory.Line.MeasureLine:
|
|
|
case VectorCategory.Line.PositionLine:
|
|
|
+ console.log(vector);
|
|
|
this.drawLineText(vector, style.text);
|
|
|
|
|
|
if (
|