|
@@ -44,7 +44,7 @@ export class IconTextItem extends SGraphItem {
|
|
|
}
|
|
|
|
|
|
/** 是否显示文字 */
|
|
|
- _showText: boolean = true;
|
|
|
+ _showText: boolean = false;
|
|
|
get showText(): boolean {
|
|
|
return this._showText;
|
|
|
}
|
|
@@ -76,6 +76,7 @@ export class IconTextItem extends SGraphItem {
|
|
|
return;
|
|
|
}
|
|
|
this._selected = value;
|
|
|
+ this.showText = value;
|
|
|
// 选中时
|
|
|
if (value) {
|
|
|
this.img.scale = 1.25;
|
|
@@ -214,9 +215,13 @@ export class IconTextItem extends SGraphItem {
|
|
|
this.img.url = IconTextItem.imgSource;
|
|
|
this.img.origin = new SPoint(14, 33);
|
|
|
this.isTransform = false;
|
|
|
+ this.zOrder = ItemOrder.markOrder;
|
|
|
+ this.selectable = true;
|
|
|
if (data.text && data.text.length) {
|
|
|
data.text.forEach((it: string) => {
|
|
|
const textItem = new STextItem(this, it);
|
|
|
+ textItem.visible = false;
|
|
|
+ textItem.origin = new SPoint(-15, 37);
|
|
|
this.addTextItem(textItem);
|
|
|
});
|
|
|
}
|
|
@@ -291,7 +296,7 @@ export class IconTextItem extends SGraphItem {
|
|
|
const rect = this.boundingRect();
|
|
|
const lw = painter.toPx(1);
|
|
|
// 编辑态和选中态出现绘制区域
|
|
|
- if (this.status == SItemStatus.Edit || this.selected) {
|
|
|
+ if (this.status == SItemStatus.Edit) {
|
|
|
// doto 如果子元素被选中
|
|
|
painter.pen.lineWidth = lw;
|
|
|
painter.pen.lineDash = [3 * lw, 7 * lw];
|