|
@@ -41,6 +41,7 @@ export class LineSegmentDrawer extends Drawer {
|
|
|
this.aggregatorB = aggregator;
|
|
|
this.setPointB(aggregator.genericObject);
|
|
|
}
|
|
|
+
|
|
|
draw() {
|
|
|
const points = Selector.getSelectedPoints();
|
|
|
if (points == undefined || points.length < 1) {
|
|
@@ -137,7 +138,7 @@ export class LineSegmentDrawer extends Drawer {
|
|
|
|
|
|
static getKonvaLine(pointA, pointB, useLabel) {
|
|
|
const points = [pointA.posX, pointA.posY, pointB.posX, pointB.posY];
|
|
|
- return new Konva.Line({
|
|
|
+ const line = new Konva.Line({
|
|
|
points: points,
|
|
|
stroke: "grey",
|
|
|
strokeWidth: 2,
|
|
@@ -150,9 +151,21 @@ export class LineSegmentDrawer extends Drawer {
|
|
|
selectable: false,
|
|
|
draggable: false
|
|
|
});
|
|
|
+ LineSegmentDrawer.configureLineEvents(line);
|
|
|
+ return line;
|
|
|
+ }
|
|
|
+ static configureLineEvents(line) {
|
|
|
+ console.info("configureLine");
|
|
|
+ line.on("click tap", function(e) {
|
|
|
+ console.info("linha clicada", e);
|
|
|
+ console.info("linha clicada", this);
|
|
|
+ this.pointDrawer.drawPoint();
|
|
|
+ });
|
|
|
+ return line;
|
|
|
}
|
|
|
|
|
|
static drawKonvaLine(pointA, pointB) {
|
|
|
const line = LineSegmentDrawer.getKonvaLine(pointA, pointB);
|
|
|
+ return line;
|
|
|
}
|
|
|
}
|