YaolongHan преди 4 години
родител
ревизия
c5498ec153
променени са 2 файла, в които са добавени 10 реда и са изтрити 0 реда
  1. 1 0
      src/lib/items/SImageLegendItem.ts
  2. 9 0
      src/lib/items/SImgTextItem.ts

+ 1 - 0
src/lib/items/SImageLegendItem.ts

@@ -31,6 +31,7 @@ export class SImageLegendItem extends SImgTextItem {
         this.update();
     }
 
+
     /**
      * 构造函数
      *

+ 9 - 0
src/lib/items/SImgTextItem.ts

@@ -60,6 +60,15 @@ export class SImgTextItem extends SObjectItem {
     this.update();
   } // Set y
 
+  /** icon宽 */
+  get width(): number {
+    return this.img.width;
+  }
+  set width(v: number) {
+    this.img.width = v
+    this.update();
+  }
+
   /** 是否显示锚点  */
   _showAnchor: boolean = false;
   get showAnchor(): boolean {