Преглед изворни кода

'图标大小字段修改'

zhangyu пре 4 година
родитељ
комит
d6141b80b0
2 измењених фајлова са 14 додато и 8 уклоњено
  1. 4 2
      src/components/mapClass/EditScence.ts
  2. 10 6
      src/lib/items/SImageLegendItem.ts

+ 4 - 2
src/components/mapClass/EditScence.ts

@@ -452,8 +452,10 @@ export class EditScence extends SGraphScene {
                 IconUrl: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Url: '/serve/topology-wanda/Picture/query/' + this._legend.Url,
                 Num: 1, // 此num与信息工程化得num无关
-                sWidth: this._legend.Size?this._legend.Size.Width?this._legend.Size.Width:32:32,  //icon 的宽
-                sHeight: this._legend.Size?this._legend.Size.Height?this._legend.Size.Height:32:32,   //icon 的高
+                Size: {
+                    Width: this._legend.Size?this._legend.Size.Width?this._legend.Size.Width:32:32,  //icon 的宽
+                    Height: this._legend.Size?this._legend.Size.Height?this._legend.Size.Height:32:32,   //icon 的高
+                },
                 font: 16,    //font
                 color: "#1F2429",  //字体颜色
                 FrameColor: this._legend.FrameColor,

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

@@ -90,11 +90,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);
@@ -130,10 +130,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 => {