|
@@ -39,7 +39,7 @@ export class MiddlePointDrawer extends SelectableDrawer {
|
|
this.states = [MiddlePointDrawer.FIRST_POINT_STATE, MiddlePointDrawer.SECOND_POINT_STATE];
|
|
this.states = [MiddlePointDrawer.FIRST_POINT_STATE, MiddlePointDrawer.SECOND_POINT_STATE];
|
|
this.middlePoint;
|
|
this.middlePoint;
|
|
this.pointDrawer = new PointDrawer();
|
|
this.pointDrawer = new PointDrawer();
|
|
- super.setElementClass(ELEMENTS_CLASS.LINE_SEGMENT);
|
|
|
|
|
|
+ super.setElementClass(ELEMENTS_CLASS.MIDDLE_POINT);
|
|
}
|
|
}
|
|
|
|
|
|
setPointA(point) {
|
|
setPointA(point) {
|
|
@@ -129,10 +129,9 @@ export class MiddlePointDrawer extends SelectableDrawer {
|
|
this.middlePoint = middlePoint;
|
|
this.middlePoint = middlePoint;
|
|
const group = SelectableDrawer.getKonvaGroup(false);
|
|
const group = SelectableDrawer.getKonvaGroup(false);
|
|
const text = MiddlePointDrawer.getKonvaText(middlePoint, middlePoint.label);
|
|
const text = MiddlePointDrawer.getKonvaText(middlePoint, middlePoint.label);
|
|
|
|
+ const line = MiddlePointDrawer.getKonvaLine(middlePoint.pointA, middlePoint.pointB);
|
|
group.add(text);
|
|
group.add(text);
|
|
- group.add(this.aggregatorC.konvaObject);
|
|
|
|
- const konvaObject = MiddlePointDrawer.getKonvaLine(middlePoint.pointA, middlePoint.pointB);
|
|
|
|
- group.add(konvaObject);
|
|
|
|
|
|
+ group.add(line);
|
|
super.setKonvaObject(group);
|
|
super.setKonvaObject(group);
|
|
const aggregator = new DrawerAggregator(
|
|
const aggregator = new DrawerAggregator(
|
|
this, this.middlePoint,
|
|
this, this.middlePoint,
|
|
@@ -186,9 +185,10 @@ export class MiddlePointDrawer extends SelectableDrawer {
|
|
pointA.posX, pointA.posY,
|
|
pointA.posX, pointA.posY,
|
|
pointB.posX, pointB.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);
|
|
|
|
|
|
+ console.log("aggregator-update", aggregator.drawer)
|
|
|
|
+ const text = aggregator.drawer.aggregatorC.konvaObject.children[0]
|
|
|
|
+ const middlePoint = aggregator.drawer.aggregatorC.konvaObject.children[1]
|
|
|
|
+ text.x(pointC.posX + 10);
|
|
text.y(pointC.posY - 10);
|
|
text.y(pointC.posY - 10);
|
|
middlePoint.x(pointC.posX);
|
|
middlePoint.x(pointC.posX);
|
|
middlePoint.y(pointC.posY);
|
|
middlePoint.y(pointC.posY);
|