"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.SWindowItem = void 0; const lib_1 = require("@persagy-web/draw/lib"); const __1 = require("../.."); const __2 = require("../.."); const lib_2 = require("@persagy-web/graph/lib"); class SWindowItem extends lib_2.SGraphItem { constructor(parent, data) { super(parent); this.pointArr = []; this.minX = Number.MAX_SAFE_INTEGER; this.maxX = Number.MIN_SAFE_INTEGER; this.minY = Number.MAX_SAFE_INTEGER; this.maxY = Number.MIN_SAFE_INTEGER; this.data = data; this.zOrder = __1.ItemOrder.windowOrder; if (this.data.OutLine.length) { this.pointArr = this.data.OutLine[0].map((t) => { let x = t.X, y = -t.Y; if (x < this.minX) { this.minX = x; } if (y < this.minY) { this.minY = y; } if (x > this.maxX) { this.maxX = x; } if (y > this.maxY) { this.maxY = y; } return new lib_1.SPoint(t.X, -t.Y); }); } } boundingRect() { return new lib_1.SRect(this.minX, this.minY, this.maxX - this.minX, this.maxY - this.minY); } onDraw(painter) { painter.pen.color = __2.ItemColor.windowColor; painter.pen.lineWidth = painter.toPx(1); painter.drawPolyline(this.pointArr); } } exports.SWindowItem = SWindowItem;