123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- exports.STextMarkerItem = void 0;
- const lib_1 = require("@persagy-web/graph/lib");
- const draw_1 = require("@persagy-web/draw");
- class STextMarkerItem extends lib_1.STextItem {
- constructor(parent, data) {
- super(parent);
- this._scaleX = 1;
- this._scaleY = 1;
- this._rolate = 0;
- this.data = data;
- this.moveTo(data.Pos.X, data.Pos.Y);
- if (this.data.Scale) {
- this.scaleX = this.data.Scale.X;
- this.scaleY = this.data.Scale.Y;
- }
- if (this.data.Rolate && this.data.Rolate.Z) {
- this.rolate = this.data.Rolate.Z;
- }
- if (this.data.Size) {
- this.width = this.data.Size.Width;
- this.height = this.data.Size.Height;
- }
- if (this.data.Properties && this.data.Properties.Text) {
- if (this.data.Properties.Text instanceof String) {
- this.text = this.data.Properties.Text;
- }
- }
- }
- get scaleX() {
- return this._scaleX;
- }
- set scaleX(v) {
- this._scaleX = v;
- if (this.data.Scale) {
- this.data.Scale.X = v;
- }
- this.update();
- }
- get scaleY() {
- return this._scaleY;
- }
- set scaleY(v) {
- this._scaleY = v;
- if (this.data.Scale) {
- this.data.Scale.Y = v;
- }
- this.update();
- }
- get rolate() {
- return this._rolate;
- }
- set rolate(v) {
- this._rolate = v;
- if (this.data.Rolate) {
- this.data.Rolate.Z = v;
- }
- this.update();
- }
- set name(v) {
- this.data.Name = v;
- }
- set text(v) {
- if (this.data.Properties) {
- this.data.Properties.Text = v;
- }
- }
- set x(v) {
- this.data.Pos.X = v;
- }
- set y(v) {
- this.data.Pos.Y = v;
- }
- set width(v) {
- if (this.data.Size) {
- this.data.Size.Width = v;
- }
- }
- set height(v) {
- if (this.data.Size) {
- this.data.Size.Height = v;
- }
- }
- onDraw(painter) {
- painter.brush.color = new draw_1.SColor(this.color);
- painter.font = this.font;
- painter.scale(this.scaleX, this.scaleY);
- painter.rotate(this.rolate);
- this.drawFormatText();
- }
- }
- exports.STextMarkerItem = STextMarkerItem;
|