|
@@ -534,13 +534,34 @@ export default class Draw {
|
|
|
fo && help.setStyle(ctx, style)
|
|
|
|
|
|
drawRoadEdgeChild(rightEdge);
|
|
|
+
|
|
|
+ if (fo) {
|
|
|
+ const p1 = coordinate.getScreenXY(leftEdge.start);
|
|
|
+ const p2 = coordinate.getScreenXY(rightEdge.start);
|
|
|
+ const p3 = coordinate.getScreenXY(leftEdge.end);
|
|
|
+ const p4 = coordinate.getScreenXY(rightEdge.end);
|
|
|
+ ctx.lineWidth = 1 * coordinate.ratio
|
|
|
+ ctx.setLineDash([5 * coordinate.ratio, 5 * coordinate.ratio ]);
|
|
|
+
|
|
|
+ ctx.beginPath()
|
|
|
+ ctx.moveTo(p1.x, p1.y)
|
|
|
+ ctx.lineTo(p2.x, p2.y)
|
|
|
+ ctx.stroke()
|
|
|
+ ctx.beginPath()
|
|
|
+ ctx.moveTo(p3.x, p3.y)
|
|
|
+ ctx.lineTo(p4.x, p4.y)
|
|
|
+ ctx.stroke()
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
ctx.restore();
|
|
|
|
|
|
if (import.meta.env.DEV) {
|
|
|
- this.drawPoint(leftEdge.start);
|
|
|
- this.drawPoint(leftEdge.end);
|
|
|
- this.drawPoint(rightEdge.start);
|
|
|
- this.drawPoint(rightEdge.end);
|
|
|
+ // this.drawPoint(leftEdge.start);
|
|
|
+ // this.drawPoint(leftEdge.end);
|
|
|
+ // this.drawPoint(rightEdge.start);
|
|
|
+ // this.drawPoint(rightEdge.end);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -592,14 +613,14 @@ export default class Draw {
|
|
|
}
|
|
|
|
|
|
drawCurveRoad(vector) {
|
|
|
+ const ctx = this.context;
|
|
|
+ const [_, foo] = help.setVectorStyle(ctx, vector);
|
|
|
if (vector.display && vector.midDivide) {
|
|
|
const covesArray = help.transformCoves([
|
|
|
vector.midDivide.leftMidDivideCurves,
|
|
|
vector.midDivide.rightMidDivideCurves,
|
|
|
]);
|
|
|
- const ctx = this.context;
|
|
|
ctx.save();
|
|
|
- help.setVectorStyle(ctx, vector);
|
|
|
ctx.lineWidth *= Settings.lineWidth
|
|
|
for (let coves of covesArray) {
|
|
|
help.drawCoves(ctx, coves);
|
|
@@ -614,6 +635,30 @@ export default class Draw {
|
|
|
vector.rightLanesCurves &&
|
|
|
vector.rightLanesCurves.forEach(this.drawCurveLan.bind(this));
|
|
|
|
|
|
+
|
|
|
+ if (foo) {
|
|
|
+ const leftEdge = dataService.getCurveRoadEdge(vector.leftEdgeId)
|
|
|
+ const rightEdge = dataService.getCurveRoadEdge(vector.rightEdgeId)
|
|
|
+ const p1 = coordinate.getScreenXY(leftEdge.start);
|
|
|
+ const p2 = coordinate.getScreenXY(rightEdge.start);
|
|
|
+ const p3 = coordinate.getScreenXY(leftEdge.end);
|
|
|
+ const p4 = coordinate.getScreenXY(rightEdge.end);
|
|
|
+ ctx.save();
|
|
|
+ ctx.setLineDash([5 * coordinate.ratio, 5 * coordinate.ratio ]);
|
|
|
+ ctx.lineWidth = 1 * coordinate.ratio
|
|
|
+ ctx.strokeStyle = Style.Lane.strokeStyle
|
|
|
+ ctx.beginPath()
|
|
|
+ ctx.moveTo(p1.x, p1.y)
|
|
|
+ ctx.lineTo(p2.x, p2.y)
|
|
|
+ ctx.stroke()
|
|
|
+ ctx.beginPath()
|
|
|
+ ctx.moveTo(p3.x, p3.y)
|
|
|
+ ctx.lineTo(p4.x, p4.y)
|
|
|
+ ctx.stroke()
|
|
|
+ ctx.restore();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// if (import.meta.env.DEV) {
|
|
|
vector.points.forEach(this.drawPoint.bind(this));
|
|
|
// }
|
|
@@ -622,6 +667,7 @@ export default class Draw {
|
|
|
drawCurveRoadEdge(vector, roadVector) {
|
|
|
const [coves] = help.transformCoves([vector.curves]);
|
|
|
const ctx = this.context;
|
|
|
+ console.log(coves)
|
|
|
const [style, select] = help.getVectorStyle(roadVector)
|
|
|
ctx.save();
|
|
|
help.setVectorStyle(ctx, vector);
|
|
@@ -655,7 +701,7 @@ export default class Draw {
|
|
|
}
|
|
|
|
|
|
drawRoadPoint(vector) {
|
|
|
- this.drawPoint(vector);
|
|
|
+ vector.display && this.drawPoint(vector);
|
|
|
}
|
|
|
|
|
|
drawArrow(vector) {
|
|
@@ -705,10 +751,7 @@ export default class Draw {
|
|
|
y: vector.popPosition.y,
|
|
|
};
|
|
|
const offset = radius / 2;
|
|
|
- const targetPts =
|
|
|
- style === Style.Focus.Magnifier
|
|
|
- ? [mathUtil.translate(pt, target, pt, radius), target]
|
|
|
- : null;
|
|
|
+ const targetPts =[mathUtil.translate(pt, target, pt, radius), target];
|
|
|
|
|
|
ctx.save();
|
|
|
ctx.beginPath();
|
|
@@ -796,7 +839,8 @@ export default class Draw {
|
|
|
}
|
|
|
|
|
|
drawCircle(element) {
|
|
|
- this.drawElliptic(element, element.radius, element.radius)
|
|
|
+ this.drawElliptic(element, element.radiusX, element.radiusY)
|
|
|
+ console.log(element)
|
|
|
const [_, label] = help.getVectorStyle(element);
|
|
|
label && element.points.forEach((point) => this.drawPoint(point));
|
|
|
}
|