{"version":3,"file":"Rectangle.mjs","sources":["../../../src/maths/shapes/Rectangle.ts"],"sourcesContent":["// import { SHAPES } from '../const';\nimport { Point } from '../point/Point';\n\nimport type { Bounds } from '../../scene/container/bounds/Bounds';\nimport type { Matrix } from '../matrix/Matrix';\nimport type { SHAPE_PRIMITIVE } from '../misc/const';\nimport type { ShapePrimitive } from './ShapePrimitive';\n\nconst tempPoints = [new Point(), new Point(), new Point(), new Point()];\n\n// eslint-disable-next-line max-len\n// eslint-disable-next-line @typescript-eslint/no-empty-object-type, requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface Rectangle extends PixiMixins.Rectangle { }\n\n/**\n * The `Rectangle` object represents a rectangular area defined by its position and dimensions.\n * Used for hit testing, bounds calculation, and general geometric operations.\n * @example\n * ```ts\n * // Basic rectangle creation\n * const rect = new Rectangle(100, 100, 200, 150);\n *\n * // Use as container bounds\n * container.hitArea = new Rectangle(0, 0, 100, 100);\n *\n * // Check point containment\n * const isInside = rect.contains(mouseX, mouseY);\n *\n * // Manipulate dimensions\n * rect.width *= 2;\n * rect.height += 50;\n * ```\n * @remarks\n * - Position defined by top-left corner (x,y)\n * - Dimensions defined by width and height\n * - Supports point and rectangle containment\n * - Common in UI and layout calculations\n * @see {@link Circle} For circular shapes\n * @see {@link Polygon} For complex shapes\n * @see {@link RoundedRectangle} For rounded corners\n * @category maths\n * @standard\n */\nexport class Rectangle implements ShapePrimitive\n{\n    /**\n     * The type of the object, mainly used to avoid `instanceof` checks\n     * @example\n     * ```ts\n     * // Check shape type\n     * const shape = new Rectangle(0, 0, 100, 100);\n     * console.log(shape.type); // 'rectangle'\n     *\n     * // Use in type guards\n     * if (shape.type === 'rectangle') {\n     *     console.log(shape.width, shape.height);\n     * }\n     * ```\n     * @readonly\n     * @default 'rectangle'\n     * @see {@link SHAPE_PRIMITIVE} For all shape types\n     */\n    public readonly type: SHAPE_PRIMITIVE = 'rectangle';\n\n    /**\n     * The X coordinate of the upper-left corner of the rectangle\n     * @example\n     * ```ts\n     * // Basic x position\n     * const rect = new Rectangle();\n     * rect.x = 100;\n     * ```\n     * @default 0\n     */\n    public x: number;\n\n    /**\n     * The Y coordinate of the upper-left corner of the rectangle\n     * @example\n     * ```ts\n     * // Basic y position\n     * const rect = new Rectangle();\n     * rect.y = 100;\n     * ```\n     * @default 0\n     */\n    public y: number;\n\n    /**\n     * The overall width of this rectangle\n     * @example\n     * ```ts\n     * // Basic width setting\n     * const rect = new Rectangle();\n     * rect.width = 200;\n     * ```\n     * @default 0\n     */\n    public width: number;\n\n    /**\n     * The overall height of this rectangle\n     * @example\n     * ```ts\n     * // Basic height setting\n     * const rect = new Rectangle();\n     * rect.height = 150;\n     * ```\n     * @default 0\n     */\n    public height: number;\n\n    /**\n     * @param x - The X coordinate of the upper-left corner of the rectangle\n     * @param y - The Y coordinate of the upper-left corner of the rectangle\n     * @param width - The overall width of the rectangle\n     * @param height - The overall height of the rectangle\n     */\n    constructor(x: string | number = 0, y: string | number = 0, width: string | number = 0, height: string | number = 0)\n    {\n        this.x = Number(x);\n        this.y = Number(y);\n        this.width = Number(width);\n        this.height = Number(height);\n    }\n\n    /**\n     * Returns the left edge (x-coordinate) of the rectangle.\n     * @example\n     * ```ts\n     * // Get left edge position\n     * const rect = new Rectangle(100, 100, 200, 150);\n     * console.log(rect.left); // 100\n     *\n     * // Use in alignment calculations\n     * sprite.x = rect.left + padding;\n     *\n     * // Compare positions\n     * if (point.x > rect.left) {\n     *     console.log('Point is right of rectangle');\n     * }\n     * ```\n     * @readonly\n     * @returns The x-coordinate of the left edge\n     * @see {@link Rectangle.right} For right edge position\n     * @see {@link Rectangle.x} For direct x-coordinate access\n     */\n    get left(): number\n    {\n        return this.x;\n    }\n\n    /**\n     * Returns the right edge (x + width) of the rectangle.\n     * @example\n     * ```ts\n     * // Get right edge position\n     * const rect = new Rectangle(100, 100, 200, 150);\n     * console.log(rect.right); // 300\n     *\n     * // Align to right edge\n     * sprite.x = rect.right - sprite.width;\n     *\n     * // Check boundaries\n     * if (point.x < rect.right) {\n     *     console.log('Point is inside right bound');\n     * }\n     * ```\n     * @readonly\n     * @returns The x-coordinate of the right edge\n     * @see {@link Rectangle.left} For left edge position\n     * @see {@link Rectangle.width} For width value\n     */\n    get right(): number\n    {\n        return this.x + this.width;\n    }\n\n    /**\n     * Returns the top edge (y-coordinate) of the rectangle.\n     * @example\n     * ```ts\n     * // Get top edge position\n     * const rect = new Rectangle(100, 100, 200, 150);\n     * console.log(rect.top); // 100\n     *\n     * // Position above rectangle\n     * sprite.y = rect.top - sprite.height;\n     *\n     * // Check vertical position\n     * if (point.y > rect.top) {\n     *     console.log('Point is below top edge');\n     * }\n     * ```\n     * @readonly\n     * @returns The y-coordinate of the top edge\n     * @see {@link Rectangle.bottom} For bottom edge position\n     * @see {@link Rectangle.y} For direct y-coordinate access\n     */\n    get top(): number\n    {\n        return this.y;\n    }\n\n    /**\n     * Returns the bottom edge (y + height) of the rectangle.\n     * @example\n     * ```ts\n     * // Get bottom edge position\n     * const rect = new Rectangle(100, 100, 200, 150);\n     * console.log(rect.bottom); // 250\n     *\n     * // Stack below rectangle\n     * sprite.y = rect.bottom + margin;\n     *\n     * // Check vertical bounds\n     * if (point.y < rect.bottom) {\n     *     console.log('Point is above bottom edge');\n     * }\n     * ```\n     * @readonly\n     * @returns The y-coordinate of the bottom edge\n     * @see {@link Rectangle.top} For top edge position\n     * @see {@link Rectangle.height} For height value\n     */\n    get bottom(): number\n    {\n        return this.y + this.height;\n    }\n\n    /**\n     * Determines whether the Rectangle is empty (has no area).\n     * @example\n     * ```ts\n     * // Check zero dimensions\n     * const rect = new Rectangle(100, 100, 0, 50);\n     * console.log(rect.isEmpty()); // true\n     * ```\n     * @returns True if the rectangle has no area\n     * @see {@link Rectangle.width} For width value\n     * @see {@link Rectangle.height} For height value\n     */\n    public isEmpty(): boolean\n    {\n        return this.left === this.right || this.top === this.bottom;\n    }\n\n    /**\n     * A constant empty rectangle. This is a new object every time the property is accessed.\n     * @example\n     * ```ts\n     * // Get fresh empty rectangle\n     * const empty = Rectangle.EMPTY;\n     * console.log(empty.isEmpty()); // true\n     * ```\n     * @returns A new empty rectangle instance\n     * @see {@link Rectangle.isEmpty} For empty state testing\n     */\n    static get EMPTY(): Rectangle\n    {\n        return new Rectangle(0, 0, 0, 0);\n    }\n\n    /**\n     * Creates a clone of this Rectangle\n     * @example\n     * ```ts\n     * // Basic cloning\n     * const original = new Rectangle(100, 100, 200, 150);\n     * const copy = original.clone();\n     *\n     * // Clone and modify\n     * const modified = original.clone();\n     * modified.width *= 2;\n     * modified.height += 50;\n     *\n     * // Verify independence\n     * console.log(original.width);  // 200\n     * console.log(modified.width);  // 400\n     * ```\n     * @returns A copy of the rectangle\n     * @see {@link Rectangle.copyFrom} For copying into existing rectangle\n     * @see {@link Rectangle.copyTo} For copying to another rectangle\n     */\n    public clone(): Rectangle\n    {\n        return new Rectangle(this.x, this.y, this.width, this.height);\n    }\n\n    /**\n     * Converts a Bounds object to a Rectangle object.\n     * @example\n     * ```ts\n     * // Convert bounds to rectangle\n     * const bounds = container.getBounds();\n     * const rect = new Rectangle().copyFromBounds(bounds);\n     * ```\n     * @param bounds - The bounds to copy and convert to a rectangle\n     * @returns Returns itself\n     * @see {@link Bounds} For bounds object structure\n     * @see {@link Rectangle.getBounds} For getting rectangle bounds\n     */\n    public copyFromBounds(bounds: Bounds): this\n    {\n        this.x = bounds.minX;\n        this.y = bounds.minY;\n        this.width = bounds.maxX - bounds.minX;\n        this.height = bounds.maxY - bounds.minY;\n\n        return this;\n    }\n\n    /**\n     * Copies another rectangle to this one.\n     * @example\n     * ```ts\n     * // Basic copying\n     * const source = new Rectangle(100, 100, 200, 150);\n     * const target = new Rectangle();\n     * target.copyFrom(source);\n     *\n     * // Chain with other operations\n     * const rect = new Rectangle()\n     *     .copyFrom(source)\n     *     .pad(10);\n     * ```\n     * @param rectangle - The rectangle to copy from\n     * @returns Returns itself\n     * @see {@link Rectangle.copyTo} For copying to another rectangle\n     * @see {@link Rectangle.clone} For creating new rectangle copy\n     */\n    public copyFrom(rectangle: Rectangle): Rectangle\n    {\n        this.x = rectangle.x;\n        this.y = rectangle.y;\n        this.width = rectangle.width;\n        this.height = rectangle.height;\n\n        return this;\n    }\n\n    /**\n     * Copies this rectangle to another one.\n     * @example\n     * ```ts\n     * // Basic copying\n     * const source = new Rectangle(100, 100, 200, 150);\n     * const target = new Rectangle();\n     * source.copyTo(target);\n     *\n     * // Chain with other operations\n     * const result = source\n     *     .copyTo(new Rectangle())\n     *     .getBounds();\n     * ```\n     * @param rectangle - The rectangle to copy to\n     * @returns Returns given parameter\n     * @see {@link Rectangle.copyFrom} For copying from another rectangle\n     * @see {@link Rectangle.clone} For creating new rectangle copy\n     */\n    public copyTo(rectangle: Rectangle): Rectangle\n    {\n        rectangle.copyFrom(this);\n\n        return rectangle;\n    }\n\n    /**\n     * Checks whether the x and y coordinates given are contained within this Rectangle\n     * @example\n     * ```ts\n     * // Basic containment check\n     * const rect = new Rectangle(100, 100, 200, 150);\n     * const isInside = rect.contains(150, 125); // true\n     * // Check edge cases\n     * console.log(rect.contains(100, 100)); // true (on edge)\n     * console.log(rect.contains(300, 250)); // false (outside)\n     * ```\n     * @param x - The X coordinate of the point to test\n     * @param y - The Y coordinate of the point to test\n     * @returns Whether the x/y coordinates are within this Rectangle\n     * @see {@link Rectangle.containsRect} For rectangle containment\n     * @see {@link Rectangle.strokeContains} For checking stroke intersection\n     */\n    public contains(x: number, y: number): boolean\n    {\n        if (this.width <= 0 || this.height <= 0)\n        {\n            return false;\n        }\n\n        if (x >= this.x && x < this.x + this.width)\n        {\n            if (y >= this.y && y < this.y + this.height)\n            {\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Checks whether the x and y coordinates given are contained within this rectangle including the stroke.\n     * @example\n     * ```ts\n     * // Basic stroke check\n     * const rect = new Rectangle(100, 100, 200, 150);\n     * const isOnStroke = rect.strokeContains(150, 100, 4); // 4px line width\n     *\n     * // Check with different alignments\n     * const innerStroke = rect.strokeContains(150, 100, 4, 1);   // Inside\n     * const centerStroke = rect.strokeContains(150, 100, 4, 0.5); // Centered\n     * const outerStroke = rect.strokeContains(150, 100, 4, 0);   // Outside\n     * ```\n     * @param x - The X coordinate of the point to test\n     * @param y - The Y coordinate of the point to test\n     * @param strokeWidth - The width of the line to check\n     * @param alignment - The alignment of the stroke (1 = inner, 0.5 = centered, 0 = outer)\n     * @returns Whether the x/y coordinates are within this rectangle's stroke\n     * @see {@link Rectangle.contains} For checking fill containment\n     * @see {@link Rectangle.getBounds} For getting stroke bounds\n     */\n    public strokeContains(x: number, y: number, strokeWidth: number, alignment: number = 0.5): boolean\n    {\n        const { width, height } = this;\n\n        if (width <= 0 || height <= 0) return false;\n\n        const _x = this.x;\n        const _y = this.y;\n\n        const strokeWidthOuter = strokeWidth * (1 - alignment);\n        const strokeWidthInner = strokeWidth - strokeWidthOuter;\n\n        const outerLeft = _x - strokeWidthOuter;\n        const outerRight = _x + width + strokeWidthOuter;\n        const outerTop = _y - strokeWidthOuter;\n        const outerBottom = _y + height + strokeWidthOuter;\n\n        const innerLeft = _x + strokeWidthInner;\n        const innerRight = _x + width - strokeWidthInner;\n        const innerTop = _y + strokeWidthInner;\n        const innerBottom = _y + height - strokeWidthInner;\n\n        return (x >= outerLeft && x <= outerRight && y >= outerTop && y <= outerBottom)\n            && !(x > innerLeft && x < innerRight && y > innerTop && y < innerBottom);\n    }\n    /**\n     * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.\n     * Returns true only if the area of the intersection is >0, this means that Rectangles\n     * sharing a side are not overlapping. Another side effect is that an arealess rectangle\n     * (width or height equal to zero) can't intersect any other rectangle.\n     * @param {Rectangle} other - The Rectangle to intersect with `this`.\n     * @param {Matrix} transform - The transformation matrix of `other`.\n     * @returns {boolean} A value of `true` if the transformed `other` Rectangle intersects with `this`; otherwise `false`.\n     */\n    /**\n     * Determines whether the `other` Rectangle transformed by `transform` intersects with `this` Rectangle object.\n     *\n     * Returns true only if the area of the intersection is greater than 0.\n     * This means that rectangles sharing only a side are not considered intersecting.\n     * @example\n     * ```ts\n     * // Basic intersection check\n     * const rect1 = new Rectangle(0, 0, 100, 100);\n     * const rect2 = new Rectangle(50, 50, 100, 100);\n     * console.log(rect1.intersects(rect2)); // true\n     *\n     * // With transformation matrix\n     * const matrix = new Matrix();\n     * matrix.rotate(Math.PI / 4); // 45 degrees\n     * console.log(rect1.intersects(rect2, matrix)); // Checks with rotation\n     *\n     * // Edge cases\n     * const zeroWidth = new Rectangle(0, 0, 0, 100);\n     * console.log(rect1.intersects(zeroWidth)); // false (no area)\n     * ```\n     * @remarks\n     * - Returns true only if intersection area is > 0\n     * - Rectangles sharing only a side are not intersecting\n     * - Zero-area rectangles cannot intersect anything\n     * - Supports optional transformation matrix\n     * @param other - The Rectangle to intersect with `this`\n     * @param transform - Optional transformation matrix of `other`\n     * @returns True if the transformed `other` Rectangle intersects with `this`\n     * @see {@link Rectangle.containsRect} For containment testing\n     * @see {@link Rectangle.contains} For point testing\n     */\n    public intersects(other: Rectangle, transform?: Matrix): boolean\n    {\n        if (!transform)\n        {\n            const x0 = this.x < other.x ? other.x : this.x;\n            const x1 = this.right > other.right ? other.right : this.right;\n\n            if (x1 <= x0)\n            {\n                return false;\n            }\n\n            const y0 = this.y < other.y ? other.y : this.y;\n            const y1 = this.bottom > other.bottom ? other.bottom : this.bottom;\n\n            return y1 > y0;\n        }\n\n        const x0 = this.left;\n        const x1 = this.right;\n        const y0 = this.top;\n        const y1 = this.bottom;\n\n        if (x1 <= x0 || y1 <= y0)\n        {\n            return false;\n        }\n\n        const lt = tempPoints[0].set(other.left, other.top);\n        const lb = tempPoints[1].set(other.left, other.bottom);\n        const rt = tempPoints[2].set(other.right, other.top);\n        const rb = tempPoints[3].set(other.right, other.bottom);\n\n        if (rt.x <= lt.x || lb.y <= lt.y)\n        {\n            return false;\n        }\n\n        const s = Math.sign((transform.a * transform.d) - (transform.b * transform.c));\n\n        if (s === 0)\n        {\n            return false;\n        }\n\n        transform.apply(lt, lt);\n        transform.apply(lb, lb);\n        transform.apply(rt, rt);\n        transform.apply(rb, rb);\n\n        if (Math.max(lt.x, lb.x, rt.x, rb.x) <= x0\n            || Math.min(lt.x, lb.x, rt.x, rb.x) >= x1\n            || Math.max(lt.y, lb.y, rt.y, rb.y) <= y0\n            || Math.min(lt.y, lb.y, rt.y, rb.y) >= y1)\n        {\n            return false;\n        }\n\n        const nx = s * (lb.y - lt.y);\n        const ny = s * (lt.x - lb.x);\n        const n00 = (nx * x0) + (ny * y0);\n        const n10 = (nx * x1) + (ny * y0);\n        const n01 = (nx * x0) + (ny * y1);\n        const n11 = (nx * x1) + (ny * y1);\n\n        if (Math.max(n00, n10, n01, n11) <= (nx * lt.x) + (ny * lt.y)\n            || Math.min(n00, n10, n01, n11) >= (nx * rb.x) + (ny * rb.y))\n        {\n            return false;\n        }\n\n        const mx = s * (lt.y - rt.y);\n        const my = s * (rt.x - lt.x);\n        const m00 = (mx * x0) + (my * y0);\n        const m10 = (mx * x1) + (my * y0);\n        const m01 = (mx * x0) + (my * y1);\n        const m11 = (mx * x1) + (my * y1);\n\n        if (Math.max(m00, m10, m01, m11) <= (mx * lt.x) + (my * lt.y)\n            || Math.min(m00, m10, m01, m11) >= (mx * rb.x) + (my * rb.y))\n        {\n            return false;\n        }\n\n        return true;\n    }\n\n    /**\n     * Pads the rectangle making it grow in all directions.\n     *\n     * If paddingY is omitted, both paddingX and paddingY will be set to paddingX.\n     * @example\n     * ```ts\n     * // Basic padding\n     * const rect = new Rectangle(100, 100, 200, 150);\n     * rect.pad(10); // Adds 10px padding on all sides\n     *\n     * // Different horizontal and vertical padding\n     * const uiRect = new Rectangle(0, 0, 100, 50);\n     * uiRect.pad(20, 10); // 20px horizontal, 10px vertical\n     * ```\n     * @remarks\n     * - Adjusts x/y by subtracting padding\n     * - Increases width/height by padding * 2\n     * - Common in UI layout calculations\n     * - Chainable with other methods\n     * @param paddingX - The horizontal padding amount\n     * @param paddingY - The vertical padding amount\n     * @returns Returns itself\n     * @see {@link Rectangle.enlarge} For growing to include another rectangle\n     * @see {@link Rectangle.fit} For shrinking to fit within another rectangle\n     */\n    public pad(paddingX = 0, paddingY = paddingX): this\n    {\n        this.x -= paddingX;\n        this.y -= paddingY;\n\n        this.width += paddingX * 2;\n        this.height += paddingY * 2;\n\n        return this;\n    }\n\n    /**\n     * Fits this rectangle around the passed one.\n     * @example\n     * ```ts\n     * // Basic fitting\n     * const container = new Rectangle(0, 0, 100, 100);\n     * const content = new Rectangle(25, 25, 200, 200);\n     * content.fit(container); // Clips to container bounds\n     * ```\n     * @param rectangle - The rectangle to fit around\n     * @returns Returns itself\n     * @see {@link Rectangle.enlarge} For growing to include another rectangle\n     * @see {@link Rectangle.pad} For adding padding around the rectangle\n     */\n    public fit(rectangle: Rectangle): this\n    {\n        const x1 = Math.max(this.x, rectangle.x);\n        const x2 = Math.min(this.x + this.width, rectangle.x + rectangle.width);\n        const y1 = Math.max(this.y, rectangle.y);\n        const y2 = Math.min(this.y + this.height, rectangle.y + rectangle.height);\n\n        this.x = x1;\n        this.width = Math.max(x2 - x1, 0);\n        this.y = y1;\n        this.height = Math.max(y2 - y1, 0);\n\n        return this;\n    }\n\n    /**\n     * Enlarges rectangle so that its corners lie on a grid defined by resolution.\n     * @example\n     * ```ts\n     * // Basic grid alignment\n     * const rect = new Rectangle(10.2, 10.6, 100.8, 100.4);\n     * rect.ceil(); // Aligns to whole pixels\n     *\n     * // Custom resolution grid\n     * const uiRect = new Rectangle(5.3, 5.7, 50.2, 50.8);\n     * uiRect.ceil(0.5); // Aligns to half pixels\n     *\n     * // Use with precision value\n     * const preciseRect = new Rectangle(20.001, 20.999, 100.001, 100.999);\n     * preciseRect.ceil(1, 0.01); // Handles small decimal variations\n     * ```\n     * @param resolution - The grid size to align to (1 = whole pixels)\n     * @param eps - Small number to prevent floating point errors\n     * @returns Returns itself\n     * @see {@link Rectangle.fit} For constraining to bounds\n     * @see {@link Rectangle.enlarge} For growing dimensions\n     */\n    public ceil(resolution = 1, eps = 0.001): this\n    {\n        const x2 = Math.ceil((this.x + this.width - eps) * resolution) / resolution;\n        const y2 = Math.ceil((this.y + this.height - eps) * resolution) / resolution;\n\n        this.x = Math.floor((this.x + eps) * resolution) / resolution;\n        this.y = Math.floor((this.y + eps) * resolution) / resolution;\n\n        this.width = x2 - this.x;\n        this.height = y2 - this.y;\n\n        return this;\n    }\n\n    /**\n     * Scales the rectangle's dimensions and position by the specified factors.\n     * @example\n     * ```ts\n     * const rect = new Rectangle(50, 50, 100, 100);\n     *\n     * // Scale uniformly\n     * rect.scale(0.5, 0.5);\n     * // rect is now: x=25, y=25, width=50, height=50\n     *\n     * // non-uniformly\n     * rect.scale(0.5, 1);\n     * // rect is now: x=25, y=50, width=50, height=100\n     * ```\n     * @param x - The factor by which to scale the horizontal properties (x, width).\n     * @param y - The factor by which to scale the vertical properties (y, height).\n     * @returns Returns itself\n     */\n    public scale(x: number, y: number = x): this\n    {\n        this.x *= x;\n        this.y *= y;\n        this.width *= x;\n        this.height *= y;\n\n        return this;\n    }\n\n    /**\n     * Enlarges this rectangle to include the passed rectangle.\n     * @example\n     * ```ts\n     * // Basic enlargement\n     * const rect = new Rectangle(50, 50, 100, 100);\n     * const other = new Rectangle(0, 0, 200, 75);\n     * rect.enlarge(other);\n     * // rect is now: x=0, y=0, width=200, height=150\n     *\n     * // Use for bounding box calculation\n     * const bounds = new Rectangle();\n     * objects.forEach((obj) => {\n     *     bounds.enlarge(obj.getBounds());\n     * });\n     * ```\n     * @param rectangle - The rectangle to include\n     * @returns Returns itself\n     * @see {@link Rectangle.fit} For shrinking to fit within another rectangle\n     * @see {@link Rectangle.pad} For adding padding around the rectangle\n     */\n    public enlarge(rectangle: Rectangle): this\n    {\n        const x1 = Math.min(this.x, rectangle.x);\n        const x2 = Math.max(this.x + this.width, rectangle.x + rectangle.width);\n        const y1 = Math.min(this.y, rectangle.y);\n        const y2 = Math.max(this.y + this.height, rectangle.y + rectangle.height);\n\n        this.x = x1;\n        this.width = x2 - x1;\n        this.y = y1;\n        this.height = y2 - y1;\n\n        return this;\n    }\n\n    /**\n     * Returns the framing rectangle of the rectangle as a Rectangle object\n     * @example\n     * ```ts\n     * // Basic bounds retrieval\n     * const rect = new Rectangle(100, 100, 200, 150);\n     * const bounds = rect.getBounds();\n     *\n     * // Reuse existing rectangle\n     * const out = new Rectangle();\n     * rect.getBounds(out);\n     * ```\n     * @param out - Optional rectangle to store the result\n     * @returns The framing rectangle\n     * @see {@link Rectangle.copyFrom} For direct copying\n     * @see {@link Rectangle.clone} For creating new copy\n     */\n    public getBounds(out?: Rectangle): Rectangle\n    {\n        out ||= new Rectangle();\n        out.copyFrom(this);\n\n        return out;\n    }\n\n    /**\n     * Determines whether another Rectangle is fully contained within this Rectangle.\n     *\n     * Rectangles that occupy the same space are considered to be containing each other.\n     *\n     * Rectangles without area (width or height equal to zero) can't contain anything,\n     * not even other arealess rectangles.\n     * @example\n     * ```ts\n     * // Check if one rectangle contains another\n     * const container = new Rectangle(0, 0, 100, 100);\n     * const inner = new Rectangle(25, 25, 50, 50);\n     *\n     * console.log(container.containsRect(inner)); // true\n     *\n     * // Check overlapping rectangles\n     * const partial = new Rectangle(75, 75, 50, 50);\n     * console.log(container.containsRect(partial)); // false\n     *\n     * // Zero-area rectangles\n     * const empty = new Rectangle(0, 0, 0, 100);\n     * console.log(container.containsRect(empty)); // false\n     * ```\n     * @param other - The Rectangle to check for containment\n     * @returns True if other is fully contained within this Rectangle\n     * @see {@link Rectangle.contains} For point containment\n     * @see {@link Rectangle.intersects} For overlap testing\n     */\n    public containsRect(other: Rectangle): boolean\n    {\n        if (this.width <= 0 || this.height <= 0) return false;\n\n        const x1 = other.x;\n        const y1 = other.y;\n        const x2 = other.x + other.width;\n        const y2 = other.y + other.height;\n\n        return x1 >= this.x && x1 < this.x + this.width\n            && y1 >= this.y && y1 < this.y + this.height\n            && x2 >= this.x && x2 < this.x + this.width\n            && y2 >= this.y && y2 < this.y + this.height;\n    }\n\n    /**\n     * Sets the position and dimensions of the rectangle.\n     * @example\n     * ```ts\n     * // Basic usage\n     * const rect = new Rectangle();\n     * rect.set(100, 100, 200, 150);\n     *\n     * // Chain with other operations\n     * const bounds = new Rectangle()\n     *     .set(0, 0, 100, 100)\n     *     .pad(10);\n     * ```\n     * @param x - The X coordinate of the upper-left corner of the rectangle\n     * @param y - The Y coordinate of the upper-left corner of the rectangle\n     * @param width - The overall width of the rectangle\n     * @param height - The overall height of the rectangle\n     * @returns Returns itself for method chaining\n     * @see {@link Rectangle.copyFrom} For copying from another rectangle\n     * @see {@link Rectangle.clone} For creating a new copy\n     */\n    public set(x: number, y: number, width: number, height: number): this\n    {\n        this.x = x;\n        this.y = y;\n        this.width = width;\n        this.height = height;\n\n        return this;\n    }\n\n    // #if _DEBUG\n    public toString(): string\n    {\n        return `[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`;\n    }\n    // #endif\n}\n"],"names":["x0","x1","y0","y1"],"mappings":";;;AAQA,MAAM,UAAA,GAAa,CAAC,IAAI,KAAA,EAAM,EAAG,IAAI,KAAA,EAAM,EAAG,IAAI,KAAA,EAAM,EAAG,IAAI,OAAO,CAAA;AAmC/D,MAAM,SAAA,CACb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0EI,WAAA,CAAY,IAAqB,CAAA,EAAG,CAAA,GAAqB,GAAG,KAAA,GAAyB,CAAA,EAAG,SAA0B,CAAA,EAClH;AAzDA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA,IAAA,CAAgB,IAAA,GAAwB,WAAA;AA0DpC,IAAA,IAAA,CAAK,CAAA,GAAI,OAAO,CAAC,CAAA;AACjB,IAAA,IAAA,CAAK,CAAA,GAAI,OAAO,CAAC,CAAA;AACjB,IAAA,IAAA,CAAK,KAAA,GAA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