|
@@ -21,6 +21,7 @@ export class SGraphyItem extends SObject {
|
|
|
} // Get scene
|
|
|
set scene(v: SGraphyScene | null) {
|
|
|
this._scene = v;
|
|
|
+ this.update();
|
|
|
} // Set scene
|
|
|
/** parent属性存值函数 */
|
|
|
private _parent: SGraphyItem | null = null;
|
|
@@ -39,7 +40,7 @@ export class SGraphyItem extends SObject {
|
|
|
this._parent.children.splice(i, 1);
|
|
|
}
|
|
|
this._parent = v;
|
|
|
-
|
|
|
+ this.update();
|
|
|
// 如果新parent不为空
|
|
|
if (this._parent != null) {
|
|
|
// 将节点加入到新parent节点中
|
|
@@ -61,6 +62,7 @@ export class SGraphyItem extends SObject {
|
|
|
if (this._parent != null) {
|
|
|
this._parent.children.sort(SGraphyItem.sortItemZOrder);
|
|
|
}
|
|
|
+ this.update();
|
|
|
} // Set zOrder
|
|
|
|
|
|
/** 位置 */
|
|
@@ -71,6 +73,7 @@ export class SGraphyItem extends SObject {
|
|
|
} // Get x
|
|
|
set x(v: number) {
|
|
|
this.pos.x = v;
|
|
|
+ this.update();
|
|
|
} // Set x
|
|
|
/** Y轴坐标 */
|
|
|
get y(): number {
|
|
@@ -78,12 +81,20 @@ export class SGraphyItem extends SObject {
|
|
|
} // Get y
|
|
|
set y(v: number) {
|
|
|
this.pos.y = v;
|
|
|
+ this.update();
|
|
|
} // Set y
|
|
|
/** 缩放比例 */
|
|
|
scale: number = 1;
|
|
|
|
|
|
/** 是否可见 */
|
|
|
- visible: boolean = true;
|
|
|
+ _visible: boolean = true;
|
|
|
+ get visible(): boolean {
|
|
|
+ return this._visible;
|
|
|
+ } // Get visible
|
|
|
+ set visible(v: boolean) {
|
|
|
+ this._visible = v;
|
|
|
+ this.update();
|
|
|
+ } // Set visible
|
|
|
|
|
|
/** 是否可以移动 */
|
|
|
moveable: boolean = false;
|
|
@@ -106,6 +117,7 @@ export class SGraphyItem extends SObject {
|
|
|
return;
|
|
|
}
|
|
|
this._selected = value;
|
|
|
+ this.update();
|
|
|
} // Set selected
|
|
|
|
|
|
/** 是否进行变形 */
|
|
@@ -186,8 +198,12 @@ export class SGraphyItem extends SObject {
|
|
|
* 更新Item
|
|
|
*/
|
|
|
update(): void {
|
|
|
- // TODO: PLX
|
|
|
- // scene?.update()
|
|
|
+ if(null != this.scene) {
|
|
|
+ const view = this.scene.view;
|
|
|
+ if(null != view) {
|
|
|
+ view.update();
|
|
|
+ }
|
|
|
+ }
|
|
|
} // Function update()
|
|
|
|
|
|
/**
|