import * as createjs from "createjs-module" export default class SelectBorder extends createjs.Shape { x1: number = 0 y1: number = 0 x2: number = 0 y2: number = 0 constructor() { super() this.visible = false } setPoint1(x: number, y: number) { this.x1 = this.x2 = x this.y1 = this.y2 = y this.visible = true } setPoint2(x: number, y: number) { if (this.visible) { this.x2 = x this.y2 = y this.reDraw() } } reDraw() { this.graphics.clear() this.graphics .setStrokeDash([5, 2], 0) .setStrokeStyle(2) .beginStroke("#888888") .drawRect(this.x1, this.y1, this.x2 - this.x1, this.y2 - this.y1) } end() { this.graphics.clear() this.visible = false } }