UNPKG

arcade-physics

Version:
22 lines 680 B
"use strict"; /** * @author Richard Davey <rich@photonstorm.com> * @copyright 2020 Photon Storm Ltd. * @license {@link https://opensource.org/licenses/MIT|MIT License} */ Object.defineProperty(exports, "__esModule", { value: true }); /** * Calculates the width/height ratio of a rectangle. * * @function Phaser.Geom.Rectangle.GetAspectRatio * @since 3.0.0 * * @param {Phaser.Geom.Rectangle} rect - The rectangle. * * @return {number} The width/height ratio of the rectangle. */ const GetAspectRatio = rect => { return rect.height === 0 ? NaN : rect.width / rect.height; }; exports.default = GetAspectRatio; //# sourceMappingURL=GetAspectRatio.js.map