|
@@ -69,6 +69,15 @@ export class SImgTextItem extends SObjectItem {
|
|
|
this.update();
|
|
|
}
|
|
|
|
|
|
+ /** icon宽 */
|
|
|
+ get height(): number {
|
|
|
+ return this.img.height;
|
|
|
+ }
|
|
|
+ set height(v: number) {
|
|
|
+ this.img.height = v
|
|
|
+ this.update();
|
|
|
+ }
|
|
|
+
|
|
|
/** 是否显示锚点 */
|
|
|
_showAnchor: boolean = false;
|
|
|
get showAnchor(): boolean {
|
|
@@ -81,13 +90,20 @@ export class SImgTextItem extends SObjectItem {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- get text():string{
|
|
|
+ get text(): string {
|
|
|
return this.textItem.text;
|
|
|
}
|
|
|
- set text(v:string){
|
|
|
+ set text(v: string) {
|
|
|
this.textItem.text = v;
|
|
|
this.update();
|
|
|
}
|
|
|
+ get color(): string {
|
|
|
+ return this.textItem.color;
|
|
|
+ }
|
|
|
+ set color(v: string) {
|
|
|
+ this.textItem.color = v;
|
|
|
+ this.update();
|
|
|
+ }
|
|
|
|
|
|
/** img Item */
|
|
|
img: SImageItem = new SImageItem(this);
|
|
@@ -161,9 +177,9 @@ export class SImgTextItem extends SObjectItem {
|
|
|
* @return SRect 所有子对象的并集
|
|
|
* */
|
|
|
boundingRect(): SRect {
|
|
|
- let rect = this.img.boundingRect().adjusted(this.img.pos.x,this.img.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))
|
|
|
+ rect = rect.unioned(this.textItem.boundingRect().adjusted(this.textItem.pos.x, this.textItem.pos.y, 0, 0))
|
|
|
}
|
|
|
return rect;
|
|
|
} // Function boundingRect()
|