|
@@ -115,7 +115,6 @@ export class MiddlePointDrawer extends SelectableDrawer {
|
|
|
|
|
|
drawByPoints(points, aggregators) {
|
|
|
if (points == undefined || points.length < 1) return;
|
|
|
- console.log("points", points);
|
|
|
this.setPointA(points[0]);
|
|
|
this.setPointB(points[1]);
|
|
|
this.setPointC(points[2]);
|
|
@@ -131,12 +130,13 @@ export class MiddlePointDrawer extends SelectableDrawer {
|
|
|
const group = SelectableDrawer.getKonvaGroup(false);
|
|
|
const text = MiddlePointDrawer.getKonvaText(middlePoint, middlePoint.label);
|
|
|
group.add(text);
|
|
|
+ group.add(this.aggregatorC.konvaObject);
|
|
|
const konvaObject = MiddlePointDrawer.getKonvaLine(middlePoint.pointA, middlePoint.pointB);
|
|
|
group.add(konvaObject);
|
|
|
super.setKonvaObject(group);
|
|
|
const aggregator = new DrawerAggregator(
|
|
|
this, this.middlePoint,
|
|
|
- group, ELEMENTS_CLASS.LINE_SEGMENT
|
|
|
+ group, ELEMENTS_CLASS.MIDDLE_POINT
|
|
|
);
|
|
|
super.addAggregator(aggregator);
|
|
|
const aggregators = this.resolveAggregators([this.middlePoint.pointA, this.middlePoint.pointB, this.middlePoint.pointC], undefined);
|
|
@@ -179,7 +179,6 @@ export class MiddlePointDrawer extends SelectableDrawer {
|
|
|
const pointB = aggregator.genericObject.pointB;
|
|
|
const pointC = aggregator.genericObject.pointC;
|
|
|
const coord = aggregator.genericObject.getMiddlePoint();
|
|
|
- console.log(aggregator.konvaObject)
|
|
|
pointC.bind(coord.posX, coord.posY);
|
|
|
aggregator.konvaObject.children[0].x(coord.posX);
|
|
|
aggregator.konvaObject.children[0].y(coord.posY - 20);
|
|
@@ -187,6 +186,12 @@ export class MiddlePointDrawer extends SelectableDrawer {
|
|
|
pointA.posX, pointA.posY,
|
|
|
pointB.posX, pointB.posY
|
|
|
]);
|
|
|
+ const text = aggregator.konvaObject.children[2].children[0]
|
|
|
+ const middlePoint = aggregator.konvaObject.children[2].children[1]
|
|
|
+ text.x(pointC.posX+ 10);
|
|
|
+ text.y(pointC.posY - 10);
|
|
|
+ middlePoint.x(pointC.posX);
|
|
|
+ middlePoint.y(pointC.posY);
|
|
|
super.batchDraw();
|
|
|
}
|
|
|
|