|
@@ -106,7 +106,9 @@ export class SImgTextItem extends SObjectItem {
|
|
|
this.textItem.moveTo(16, -6);
|
|
|
this.moveable = true;
|
|
|
this.selectable = true;
|
|
|
- this.isTransform = false
|
|
|
+ this.isTransform = false;
|
|
|
+ this.textItem.enabled = false;
|
|
|
+ this.img.enabled = false;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -150,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()
|
|
|
|