|
@@ -26,7 +26,7 @@ export class SImageLegendItem extends SIconTextItem {
|
|
|
this.data.Num = 1;
|
|
|
}
|
|
|
this.data.Properties.Num = this._num;
|
|
|
- this.textItem.text = `${this.name}${this.num > 1 ? ` × ${this.num}` : ''}`;
|
|
|
+ this.textItem.text = `${this.name}${this.num > 1 ? `×${this.num}` : ''}`;
|
|
|
this.update();
|
|
|
}
|
|
|
|
|
@@ -36,7 +36,7 @@ export class SImageLegendItem extends SIconTextItem {
|
|
|
set text(v: string) {
|
|
|
this.name = v;
|
|
|
this.data.Name = v;
|
|
|
- this.textItem.text = `${this.name}${this.num > 1 ? ` × ${this.num}` : ''}`;
|
|
|
+ this.textItem.text = `${this.name}${this.num > 1 ? `×${this.num}` : ''}`;
|
|
|
this.update();
|
|
|
}
|
|
|
|
|
@@ -78,21 +78,24 @@ export class SImageLegendItem extends SIconTextItem {
|
|
|
if (data.Properties && data.Properties.Url) {
|
|
|
this.img.url = data.Properties.Url;
|
|
|
}
|
|
|
- if (data.Properties.ImgPos) {
|
|
|
- this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
|
|
|
- }
|
|
|
- if (data.Properties.TextPos) {
|
|
|
- this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
|
|
|
- }
|
|
|
if (data.Properties && data.Properties.sWidth) {
|
|
|
this.sWidth = data.Properties.sWidth;
|
|
|
}
|
|
|
if (data.Properties && data.Properties.sHeight) {
|
|
|
this.sHeight = data.Properties.sHeight;
|
|
|
}
|
|
|
+ if (data.Properties.ImgPos) {
|
|
|
+ this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
|
|
|
+ }
|
|
|
if (data.Properties && data.Properties.font) {
|
|
|
this.font = new SFont("sans-serif", data.Properties.font);
|
|
|
}
|
|
|
+ if (data.Properties.TextPos) {
|
|
|
+ this.textItem.moveTo(data.Properties.TextPos.X, data.Properties.TextPos.Y);
|
|
|
+ } else {
|
|
|
+ // 偏移二分之一文本高度
|
|
|
+ this.textItem.moveTo((this.img.width * 0.5) + 2, -(this.font.size * 0.5));
|
|
|
+ }
|
|
|
if (data.Properties && data.Properties.color) {
|
|
|
this.color = new SColor(data.Properties.color);
|
|
|
}
|