@pixi/utils
Version:
Collection of utilities used by PixiJS
1 lines • 2.23 kB
Source Map (JSON)
{"version":3,"file":"BoundingBox.mjs","sources":["../../src/media/BoundingBox.ts"],"sourcesContent":["/**\n * A rectangular bounding box describing the boundary of an area.\n * @memberof PIXI.utils\n * @since 7.1.0\n */\nexport class BoundingBox\n{\n /** The left coordinate value of the bounding box. */\n left: number;\n /** The top coordinate value of the bounding box. */\n top: number;\n /** The right coordinate value of the bounding box. */\n right: number;\n /** The bottom coordinate value of the bounding box. */\n bottom: number;\n\n /**\n * @param left - The left coordinate value of the bounding box.\n * @param top - The top coordinate value of the bounding box.\n * @param right - The right coordinate value of the bounding box.\n * @param bottom - The bottom coordinate value of the bounding box.\n */\n constructor(left: number, top: number, right: number, bottom: number)\n {\n this.left = left;\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n }\n\n /** The width of the bounding box. */\n get width(): number { return this.right - this.left; }\n /** The height of the bounding box. */\n get height(): number { return this.bottom - this.top; }\n\n /** Determines whether the BoundingBox is empty. */\n isEmpty(): boolean\n {\n return this.left === this.right || this.top === this.bottom;\n }\n\n /** An empty BoundingBox. */\n public static readonly EMPTY = new BoundingBox(0, 0, 0, 0);\n}\n"],"names":[],"mappings":"AAKO,MAAM,eAAN,MACP;AAAA,EAgBI,WAAY,CAAA,IAAA,EAAc,GAAa,EAAA,KAAA,EAAe,MACtD,EAAA;AACI,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AACZ,IAAA,IAAA,CAAK,GAAM,GAAA,GAAA,CAAA;AACX,IAAA,IAAA,CAAK,KAAQ,GAAA,KAAA,CAAA;AACb,IAAA,IAAA,CAAK,MAAS,GAAA,MAAA,CAAA;AAAA,GAClB;AAAA,EAGA,IAAI,KAAgB,GAAA;AAAE,IAAO,OAAA,IAAA,CAAK,QAAQ,IAAK,CAAA,IAAA,CAAA;AAAA,GAAM;AAAA,EAErD,IAAI,MAAiB,GAAA;AAAE,IAAO,OAAA,IAAA,CAAK,SAAS,IAAK,CAAA,GAAA,CAAA;AAAA,GAAK;AAAA,EAGtD,OACA,GAAA;AACI,IAAA,OAAO,KAAK,IAAS,KAAA,IAAA,CAAK,KAAS,IAAA,IAAA,CAAK,QAAQ,IAAK,CAAA,MAAA,CAAA;AAAA,GACzD;AAIJ,CAAA,CAAA;AAtCO,IAAM,WAAN,GAAA,aAAA;AAAM,YAqCc,KAAQ,GAAA,IAAI,aAAY,CAAG,EAAA,CAAA,EAAG,GAAG,CAAC,CAAA;;;;"}