|
@@ -408,14 +408,18 @@ export default class Draw {
|
|
|
ctx.strokeStyle = vector.arrowColor;
|
|
|
}
|
|
|
ctx.beginPath();
|
|
|
-
|
|
|
ctx.moveTo(start.x, start.y);
|
|
|
ctx.lineTo(end.x, end.y);
|
|
|
|
|
|
- const lines = mathUtil.getArrow(start, end);
|
|
|
- ctx.moveTo(lines[0].x, lines[0].y);
|
|
|
- ctx.lineTo(lines[1].x, lines[1].y);
|
|
|
- ctx.lineTo(lines[2].x, lines[2].y);
|
|
|
+ const dires = vector.category === UIEvents.MeasureLine
|
|
|
+ ? [[start, end], [end, start]]
|
|
|
+ : [[start, end]]
|
|
|
+ for (let [start, end] of dires) {
|
|
|
+ const lines = mathUtil.getArrow(start, end);
|
|
|
+ ctx.moveTo(lines[0].x, lines[0].y);
|
|
|
+ ctx.lineTo(lines[1].x, lines[1].y);
|
|
|
+ ctx.lineTo(lines[2].x, lines[2].y);
|
|
|
+ }
|
|
|
ctx.stroke();
|
|
|
ctx.restore();
|
|
|
|
|
@@ -560,13 +564,14 @@ export default class Draw {
|
|
|
}
|
|
|
|
|
|
drawLine(vector) {
|
|
|
+ console.log(vector)
|
|
|
if ([UIEvents.Arrow, UIEvents.MeasureLine].includes(vector.category)) {
|
|
|
return this.drawArrow(vector);
|
|
|
}
|
|
|
- let start = dataService.getPoint(vector.startId);
|
|
|
- start = coordinate.getScreenXY(start);
|
|
|
- let end = dataService.getPoint(vector.endId);
|
|
|
- end = coordinate.getScreenXY(end);
|
|
|
+ const startReal = dataService.getPoint(vector.startId);
|
|
|
+ const start = coordinate.getScreenXY(startReal);
|
|
|
+ const endReal = dataService.getPoint(vector.endId);
|
|
|
+ const end = coordinate.getScreenXY(endReal);
|
|
|
|
|
|
this.context.save();
|
|
|
const style = help.setVectorStyle(
|
|
@@ -582,6 +587,8 @@ export default class Draw {
|
|
|
this.context.lineTo(end.x, end.y);
|
|
|
this.context.stroke();
|
|
|
this.context.restore();
|
|
|
+ this.drawPoint(startReal)
|
|
|
+ this.drawPoint(endReal)
|
|
|
}
|
|
|
|
|
|
drawElementLine(element) {
|