|
@@ -32,75 +32,6 @@ export class STextMarkerItem extends STextItem {
|
|
|
this.update();
|
|
|
}
|
|
|
|
|
|
- /** x轴缩放属性 */
|
|
|
- // _scaleX: number = 1;
|
|
|
- // get scaleX(): number {
|
|
|
- // return this._scaleX;
|
|
|
- // }
|
|
|
- // set scaleX(v: number) {
|
|
|
- // this._scaleX = v;
|
|
|
- // if (this.data.Scale) {
|
|
|
- // this.data.Scale.X = v;
|
|
|
- // }
|
|
|
- // this.update();
|
|
|
- // }
|
|
|
-
|
|
|
- /** y轴缩放属性 */
|
|
|
- // _scaleY: number = 1;
|
|
|
- // get scaleY(): number {
|
|
|
- // return this._scaleY;
|
|
|
- // }
|
|
|
- // set scaleY(v: number) {
|
|
|
- // this._scaleY = v;
|
|
|
- // if (this.data.Scale) {
|
|
|
- // this.data.Scale.Y = v;
|
|
|
- // }
|
|
|
- // this.update();
|
|
|
- // }
|
|
|
-
|
|
|
- /** y轴旋转属性 */
|
|
|
- // _rolate: number = 0;
|
|
|
- // get rolate(): number {
|
|
|
- // return this._rolate;
|
|
|
- // }
|
|
|
- // set rolate(v: number) {
|
|
|
- // this._rolate = v;
|
|
|
- // if (this.data.Rolate) {
|
|
|
- // this.data.Rolate.Z = v;
|
|
|
- // }
|
|
|
- // this.update();
|
|
|
- // }
|
|
|
-
|
|
|
- set name(v: string) {
|
|
|
- this.data.Name = v;
|
|
|
- }
|
|
|
-
|
|
|
- set text(v: string) {
|
|
|
- if (this.data.Properties) {
|
|
|
- this.data.Properties.Text = v;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- set x(v: number) {
|
|
|
- this.data.Pos.X = v;
|
|
|
- }
|
|
|
-
|
|
|
- set y(v: number) {
|
|
|
- this.data.Pos.Y = v;
|
|
|
- }
|
|
|
-
|
|
|
- set width(v: number) {
|
|
|
- if (this.data.Size) {
|
|
|
- this.data.Size.Width = v;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- set height(v: number) {
|
|
|
- if (this.data.Size) {
|
|
|
- this.data.Size.Height = v;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 构造函数
|
|
|
*
|
|
@@ -111,25 +42,24 @@ export class STextMarkerItem extends STextItem {
|
|
|
super(parent);
|
|
|
this.data = data;
|
|
|
this.id = data.ID;
|
|
|
+ this.name = data.Name;
|
|
|
this.moveTo(data.Pos.X, data.Pos.Y);
|
|
|
- // if (data.Scale) {
|
|
|
- // this.scaleX = data.Scale.X;
|
|
|
- // this.scaleY = data.Scale.Y;
|
|
|
- // }
|
|
|
- // if (data.Rolate && data.Rolate.Z) {
|
|
|
- // this.rolate = data.Rolate.Z;
|
|
|
- // }
|
|
|
if (data.Size) {
|
|
|
this.width = data.Size.Width;
|
|
|
this.height = data.Size.Height;
|
|
|
}
|
|
|
if (data.Properties && data.Properties.Text) {
|
|
|
- if (data.Properties.Text instanceof String) {
|
|
|
- this.text = data.Properties.Text;
|
|
|
- }
|
|
|
+ this.text = data.Properties.Text;
|
|
|
}
|
|
|
} // Constructor
|
|
|
|
|
|
+ toData(): Marker {
|
|
|
+ this.data.Pos = {X: this.x, Y: this.y};
|
|
|
+ this.data.Size = {Width: this.width, Height: this.height};
|
|
|
+ this.data.Properties.Text = this.text;
|
|
|
+ return this.data;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Item绘制操作
|
|
|
*
|
|
@@ -139,8 +69,6 @@ export class STextMarkerItem extends STextItem {
|
|
|
// 绘制文本
|
|
|
painter.brush.color = new SColor(this.color);
|
|
|
painter.font = this.font;
|
|
|
- // painter.scale(this.scaleX, this.scaleY);
|
|
|
- // painter.rotate(this.rolate);
|
|
|
if (this.borderStyle == SLineStyle.Dashed) {
|
|
|
painter.pen.lineDash = [
|
|
|
painter.toPx(this.lineWidth * 3),
|