123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.SHighlightItem = 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 SHighlightItem extends lib_2.SGraphItem {
- constructor(parent) {
- super(parent);
- this.distance = 0;
- this.type = 1;
- this._point = new lib_1.SPoint();
- this._line = new lib_1.SLine();
- this.visible = false;
- this.zOrder = __1.ItemOrder.highLightOrder;
- }
- get point() {
- return this._point;
- }
- set point(v) {
- this._point = v;
- this.type = 1;
- this.update();
- }
- get line() {
- return this._line;
- }
- set line(v) {
- this._line = v;
- this.type = 2;
- this.update();
- }
- boundingRect() {
- return new lib_1.SRect(this.point.x, this.point.y, 10, 10);
- }
- onDraw(painter) {
- if (this.type == 2) {
- painter.pen.color = __2.ItemColor.highLightLineColor;
- painter.pen.lineWidth = painter.toPx(6);
- painter.drawLine(this.line);
- }
- painter.pen.color = lib_1.SColor.Transparent;
- painter.brush.color = __2.ItemColor.highLightPointColor;
- painter.drawCircle(this.point.x, this.point.y, painter.toPx(5));
- }
- }
- exports.SHighlightItem = SHighlightItem;
|