浏览代码

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

haojianlong 5 年之前
父节点
当前提交
d45a598608
共有 1 个文件被更改,包括 4 次插入8 次删除
  1. 4 8
      src/lib/SImgTextItem.ts

+ 4 - 8
src/lib/SImgTextItem.ts

@@ -152,14 +152,10 @@ export class SImgTextItem extends SObjectItem {
    * @return  SRect   所有子对象的并集
    * @return  SRect   所有子对象的并集
    * */
    * */
   boundingRect(): 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;
     return rect;
   } // Function boundingRect()
   } // Function boundingRect()