|
@@ -65,22 +65,35 @@ export class MiddlePointDrawer extends SelectableDrawer {
|
|
}
|
|
}
|
|
|
|
|
|
draw(e) {
|
|
draw(e) {
|
|
|
|
+ console.log("a")
|
|
if (e != undefined) {
|
|
if (e != undefined) {
|
|
if (e.target != undefined && e.target.attrs.class != undefined &&
|
|
if (e.target != undefined && e.target.attrs.class != undefined &&
|
|
(e.target.attrs.class == ELEMENTS_CLASS.POINT || e.target.attrs.class == ELEMENTS_CLASS.INTERSECTION_POINT)) {
|
|
(e.target.attrs.class == ELEMENTS_CLASS.POINT || e.target.attrs.class == ELEMENTS_CLASS.INTERSECTION_POINT)) {
|
|
|
|
+ console.log("b")
|
|
this.drawByStates(e.target);
|
|
this.drawByStates(e.target);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
else if (e.attrs != undefined && e.attrs.genericObject != undefined) {
|
|
else if (e.attrs != undefined && e.attrs.genericObject != undefined) {
|
|
|
|
+ console.log("c")
|
|
this.drawByMiddlePoint(e.attrs.genericObject)
|
|
this.drawByMiddlePoint(e.attrs.genericObject)
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
const points = Selector.getSelectedPoints();
|
|
const points = Selector.getSelectedPoints();
|
|
if (points == undefined || points.length == 0) {
|
|
if (points == undefined || points.length == 0) {
|
|
this.drawByStates();
|
|
this.drawByStates();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ const pointA = points[0];
|
|
|
|
+ const pointB = points[1];
|
|
|
|
+ const coord = MiddlePointModel.getMiddlePointPos(pointA, pointB);
|
|
|
|
+ const pointC = new PointModel(coord.posX, coord.posY, Label.draw());
|
|
|
|
+ pointC.draggable = false;
|
|
|
|
+ pointC.backgroundColor = "#f54260";
|
|
|
|
+ const aggregatorC = this.pointDrawer.drawPoint(pointC);
|
|
|
|
+ this.setAggregatorC(aggregatorC);
|
|
|
|
+ points.push(pointC);
|
|
this.drawByPoints(points);
|
|
this.drawByPoints(points);
|
|
}
|
|
}
|
|
|
|
|