فهرست منبع

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

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