Quellcode durchsuchen

'图标大小存取字段修改'

zhangyu vor 4 Jahren
Ursprung
Commit
d471895c6e
1 geänderte Dateien mit 10 neuen und 6 gelöschten Zeilen
  1. 10 6
      src/lib/items/SImageLegendItem.ts

+ 10 - 6
src/lib/items/SImageLegendItem.ts

@@ -85,11 +85,11 @@ export class SImageLegendItem extends SIconTextItem {
         if (data.Properties && data.Properties.Url) {
             this.img.url = data.Properties.Url;
         }
-        if (data.Properties && data.Properties.sWidth) {
-            this.sWidth = data.Properties.sWidth;
+        if (data.Properties && data.Properties.Size && data.Properties.Size.Width) {
+            this.sWidth = data.Properties.Size.Width;
         }
-        if (data.Properties && data.Properties.sHeight) {
-            this.sHeight = data.Properties.sHeight;
+        if (data.Properties && data.Properties.Size && data.Properties.Size.Height) {
+            this.sHeight = data.Properties.Size.Height;
         }
         if (data.Properties.ImgPos) {
             this.img.moveTo(data.Properties.ImgPos.X, data.Properties.ImgPos.Y);
@@ -125,10 +125,14 @@ export class SImageLegendItem extends SIconTextItem {
         this.data.Properties.Url = this.img.url;
         this.data.Properties.TextPos = { X: this.textItem.x, Y: this.textItem.y };
         this.data.Properties.ImgPos = { X: this.img.x, Y: this.img.y };
-        this.data.Properties.sWidth = this.sWidth;
-        this.data.Properties.sHeight = this.sHeight;
+        this.data.Properties.Size = {
+            Width: this.sWidth,
+            Height: this.sHeight
+        };
         this.data.Properties.font = this.font.size;
         this.data.Properties.color = this.color.value;
+        this.data.Properties.Font = this.font.size;
+        this.data.Properties.Coler = this.color.value;
         this.data.Properties.FrameColor = this.activeColor.value;
         this.data.Properties.IsActive = this.isActive;
         this.data.AnchorList = this.anchorList.map(t => {