import * as React from "react"; import {Glyph} from "./Glyph"; import {RectF, PointF} from "../../drawing/Unit"; import {Cursor} from "../../drawing/Cursor"; import {DesignerStyleSettings} from "../DesignerStyleSettings"; const Konva = require('konva'); export class RectSelectionGlyph extends Glyph { x:number; y:number; width: number; height: number; constructor(startPos:PointF, endPos:PointF) { super(null); this.x = startPos.x; this.y = startPos.y; this.width = endPos.x - startPos.x; this.height = endPos.y - startPos.y; } hitTest(pt:PointF):Cursor { return null; } render(parentNode):void { const bounds = new RectF(this.x, this.y, this.width, this.height); parentNode.add(Glyph.fillRectangle(DesignerStyleSettings.SelectionPen, bounds)); } }