MCPcopy Create free account
hub / github.com/esengine/esengine / globalToLocalRect

Method globalToLocalRect

packages/fairygui/src/core/GObject.ts:846–861  ·  view source on GitHub ↗

* Convert global rect to local * 全局矩形转本地矩形

(
        ax: number = 0,
        ay: number = 0,
        aw: number = 0,
        ah: number = 0,
        outRect?: Rectangle
    )

Source from the content-addressed store, hash-verified

844 * 全局矩形转本地矩形
845 */
846 public globalToLocalRect(
847 ax: number = 0,
848 ay: number = 0,
849 aw: number = 0,
850 ah: number = 0,
851 outRect?: Rectangle
852 ): Rectangle {
853 outRect = outRect || new Rectangle();
854 const pt = this.globalToLocal(ax, ay);
855 outRect.x = pt.x;
856 outRect.y = pt.y;
857 const pt2 = this.globalToLocal(ax + aw, ay + ah);
858 outRect.width = pt2.x - outRect.x;
859 outRect.height = pt2.y - outRect.y;
860 return outRect;
861 }
862
863 // Disposal | 销毁
864

Callers

nothing calls this directly

Calls 1

globalToLocalMethod · 0.95

Tested by

no test coverage detected