|
@@ -23,6 +23,10 @@ export class PointDrawer extends SelectableDrawer {
|
|
|
}
|
|
|
|
|
|
draw(e) {
|
|
|
+ if (e.attrs != undefined && e.attrs.genericObject != undefined) {
|
|
|
+ const aggregator = this.drawPoint(e.attrs.genericObject);
|
|
|
+ return aggregator;
|
|
|
+ }
|
|
|
if (this.state == undefined) {
|
|
|
super.setState(this.states[0]);
|
|
|
App.setStatus("Selecione o centro do Ponto");
|
|
@@ -35,10 +39,14 @@ export class PointDrawer extends SelectableDrawer {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- drawPoint() {
|
|
|
+ drawPoint(point) {
|
|
|
const pos = App.pos();
|
|
|
- if (pos == undefined) return;
|
|
|
- const drawResult = PointDrawer.drawAndGetPoint(pos.x, pos.y, true);
|
|
|
+ let drawResult;
|
|
|
+ if (point == undefined) {
|
|
|
+ if (pos == undefined) return;
|
|
|
+ drawResult = PointDrawer.drawAndGetPoint(pos.x, pos.y, true);
|
|
|
+ } else drawResult = PointDrawer.drawPoint(point, true);
|
|
|
+
|
|
|
this.point = drawResult.geometricObject;
|
|
|
super.setKonvaObject(drawResult.konvaObject);
|
|
|
const aggregator = new DrawerAggregator(
|
|
@@ -74,6 +82,7 @@ export class PointDrawer extends SelectableDrawer {
|
|
|
static drawPoint(point, useLabel, draggable, selectable) {
|
|
|
const group = SelectableDrawer.getKonvaGroup(draggable);
|
|
|
const circle = PointDrawer.getKonvaCircle(point, draggable, selectable);
|
|
|
+
|
|
|
if (useLabel != undefined && useLabel) {
|
|
|
const label = Label.draw();
|
|
|
point.setLabel(label);
|
|
@@ -82,10 +91,12 @@ export class PointDrawer extends SelectableDrawer {
|
|
|
}
|
|
|
if (selectable == undefined || selectable)
|
|
|
SelectableDrawer.setSelectable(circle);
|
|
|
+
|
|
|
if (useLabel) {
|
|
|
group.add(circle);
|
|
|
SelectableDrawer.drawObject(group);
|
|
|
SelectableDrawer.setMaxIndex(group);
|
|
|
+ console.info("point", point);
|
|
|
return { geometricObject: point, konvaObject: group };
|
|
|
} else {
|
|
|
SelectableDrawer.drawObject(circle);
|