* Convert global point to local * 全局坐标转本地坐标
(ax: number = 0, ay: number = 0, outPoint?: Point)
| 802 | * 全局坐标转本地坐标 |
| 803 | */ |
| 804 | public globalToLocal(ax: number = 0, ay: number = 0, outPoint?: Point): Point { |
| 805 | outPoint = outPoint || new Point(); |
| 806 | outPoint.x = ax; |
| 807 | outPoint.y = ay; |
| 808 | |
| 809 | if (this._displayObject) { |
| 810 | this._displayObject.globalToLocal(outPoint, outPoint); |
| 811 | } |
| 812 | |
| 813 | if (this._pivotAsAnchor) { |
| 814 | outPoint.x -= this._pivotX * this._width; |
| 815 | outPoint.y -= this._pivotY * this._height; |
| 816 | } |
| 817 | |
| 818 | return outPoint; |
| 819 | } |
| 820 | |
| 821 | /** |
| 822 | * Convert local rect to global |
no outgoing calls
no test coverage detected