Browse Source

Merge branch 'develop' of http://39.106.8.246:3003/web/wanda-editer into develop

haojianlong 4 năm trước cách đây
mục cha
commit
d45a598608
1 tập tin đã thay đổi với 4 bổ sung8 xóa
  1. 4 8
      src/lib/SImgTextItem.ts

+ 4 - 8
src/lib/SImgTextItem.ts

@@ -152,14 +152,10 @@ export class SImgTextItem extends SObjectItem {
    * @return  SRect   所有子对象的并集
    * */
   boundingRect(): SRect {
-    let rect: SRect = new SRect();
-    this.children.forEach(t => {
-      if (rect.isNull()) {
-        rect = t.boundingRect().adjusted(t.pos.x, t.pos.y, 0, 0);
-      } else {
-        rect = rect.unioned(t.boundingRect().adjusted(t.pos.x, t.pos.y, 0, 0));
-      }
-    });
+    let rect = this.img.boundingRect().adjusted(this.img.pos.x,this.img.pos.y,0,0);
+    if (this.showText) {
+        rect = rect.unioned(this.textItem.boundingRect().adjusted(this.textItem.pos.x,this.textItem.pos.y,0,0))
+    }
     return rect;
   } // Function boundingRect()