12345678910111213141516171819202122232425262728 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.SAnchorItem = void 0;
- const lib_1 = require("@persagy-web/draw/lib");
- const SGraphItem_1 = require("../SGraphItem");
- const uuid_1 = require("uuid");
- class SAnchorItem extends SGraphItem_1.SGraphItem {
- constructor(parent = null) {
- super(parent);
- this.width = 3;
- this.height = 3;
- this.isConnected = false;
- this.dis = 3;
- this.sceneDis = 3;
- this.id = uuid_1.v1();
- }
- onDraw(painter) {
- this.sceneDis = painter.toPx(this.dis);
- painter.pen.lineWidth = painter.toPx(1);
- painter.pen.color = new lib_1.SColor("#2196f3");
- painter.brush.color = lib_1.SColor.White;
- if (this.isConnected) {
- painter.brush.color = painter.pen.color;
- }
- painter.drawRect(-this.width / 2, -this.height / 2, this.width, this.height);
- }
- }
- exports.SAnchorItem = SAnchorItem;
|