import { GeometricObject } from "../../../core/models/objects/geometric-object"; import { ELEMENTS_CLASS } from "../../../core/enums/elements-class-enum"; export class PointModel extends GeometricObject { constructor(posX, posY, label, id) { super(id); this.posX = posX; this.posY = posY; this.setLabel(label); super.setClass(ELEMENTS_CLASS.POINT); this.definitions = [{ id: this.posX + 5 }, { id: -this.posY - 5 }]; this.color = -16711936; } update(konvaObject, event) { this.posX = konvaObject.attrs.startPosX + event.target._lastPos.x; this.posY = konvaObject.attrs.startPosY + event.target._lastPos.y; this.definitions = [{ id: this.posX + 5 }, { id: -this.posY - 5 }]; } }