* Set position * 设置位置
(xv: number, yv: number)
| 146 | * 设置位置 |
| 147 | */ |
| 148 | public setXY(xv: number, yv: number): void { |
| 149 | if (this._x !== xv || this._y !== yv) { |
| 150 | const dx = xv - this._x; |
| 151 | const dy = yv - this._y; |
| 152 | this._x = xv; |
| 153 | this._y = yv; |
| 154 | |
| 155 | this.handleXYChanged(); |
| 156 | |
| 157 | this.updateGear(1); |
| 158 | |
| 159 | if (this._parent) { |
| 160 | this._parent.setBoundsChangedFlag(); |
| 161 | if (this._group) { |
| 162 | this._group.setBoundsChangedFlag(true); |
| 163 | } |
| 164 | this.emit(FGUIEvents.XY_CHANGED); |
| 165 | } |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | public get xMin(): number { |
| 170 | return this._pivotAsAnchor ? this._x - this._width * this._pivotX : this._x; |
no test coverage detected