UNPKG

arcade-physics

Version:
30 lines 1.28 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 Contains_1 = __importDefault(require("./Contains")); /** * Check to see if the Ellipse contains all four points of the given Rectangle object. * * @function Phaser.Geom.Ellipse.ContainsRect * @since 3.0.0 * * @param {Phaser.Geom.Ellipse} ellipse - The Ellipse to check. * @param {(Phaser.Geom.Rectangle|object)} rect - The Rectangle object to check if it's within the Ellipse or not. * * @return {boolean} True if all of the Rectangle coordinates are within the ellipse, otherwise false. */ const ContainsRect = (ellipse, rect) => { return ((0, Contains_1.default)(ellipse, rect.x, rect.y) && (0, Contains_1.default)(ellipse, rect.right, rect.y) && (0, Contains_1.default)(ellipse, rect.x, rect.bottom) && (0, Contains_1.default)(ellipse, rect.right, rect.bottom)); }; exports.default = ContainsRect; //# sourceMappingURL=ContainsRect.js.map