瀏覽代碼

字体大小改变,文本位置移动

zhangyu 4 年之前
父節點
當前提交
f3a519bf21
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      persagy-web-edit/src/items/SBaseIconTextEdit.ts

+ 3 - 2
persagy-web-edit/src/items/SBaseIconTextEdit.ts

@@ -254,8 +254,9 @@ export class SBaseIconTextEdit extends SGraphEdit {
     } // Get font
 
     set font(v: SFont) {
-        this.textItemList.forEach(item => {
-            item.font = v
+        this.textItemList.forEach((item: SBaseTextEdit, index: number) => {
+            item.font = v;
+            item.moveTo(this.img.width * 0.5, v.size * (index - 0.125 - 0.5 * this.textItemList.length));
         })
         this.update();
     } // Set font