UNPKG

arcade-physics

Version:
36 lines 1.3 kB
"use strict"; /** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const Rectangle_1 = __importDefault(require("../rectangle/Rectangle")); /** * Returns the bounds of the Ellipse object. * * @function Phaser.Geom.Ellipse.GetBounds * @since 3.0.0 * * @generic {Phaser.Geom.Rectangle} O - [out,$return] * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to get the bounds from. * @param {(Phaser.Geom.Rectangle|object)} [out] - A Rectangle, or rectangle-like object, to store the ellipse bounds in. If not given a new Rectangle will be created. * * @return {(Phaser.Geom.Rectangle|object)} The Rectangle object containing the Ellipse bounds. */ const GetBounds = (ellipse, out) => { if (out === undefined) { out = new Rectangle_1.default(); } out.x = ellipse.left; out.y = ellipse.top; out.width = ellipse.width; out.height = ellipse.height; return out; }; exports.default = GetBounds; //# sourceMappingURL=GetBounds.js.map