{"ast":null,"code":"/**\r\n * @author       <NAME> <<EMAIL>>\r\n * @copyright    2019 Photon Storm Ltd.\r\n * @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\r\n */\n\n/**\r\n * The Impact Body Scale component.\r\n * Should be applied as a mixin.\r\n *\r\n * @name Phaser.Physics.Impact.Components.BodyScale\r\n * @since 3.0.0\r\n */\nvar BodyScale = {\n  /**\r\n   * Sets the size of the physics body.\r\n   *\r\n   * @method Phaser.Physics.Impact.Components.BodyScale#setBodySize\r\n   * @since 3.0.0\r\n   *\r\n   * @param {number} width - The width of the body in pixels.\r\n   * @param {number} [height=width] - The height of the body in pixels.\r\n   *\r\n   * @return {this} This Game Object.\r\n   */\n  setBodySize: function setBodySize(width, height) {\n    if (height === undefined) {\n      height = width;\n    }\n\n    this.body.size.x = Math.round(width);\n    this.body.size.y = Math.round(height);\n    return this;\n  },\n\n  /**\r\n   * Sets the scale of the physics body.\r\n   *\r\n   * @method Phaser.Physics.Impact.Components.BodyScale#setBodyScale\r\n   * @since 3.0.0\r\n   *\r\n   * @param {number} scaleX - The horizontal scale of the body.\r\n   * @param {number} [scaleY] - The vertical scale of the body. If not given, will use the horizontal scale value.\r\n   *\r\n   * @return {this} This Game Object.\r\n   */\n  setBodyScale: function setBodyScale(scaleX, scaleY) {\n    if (scaleY === undefined) {\n      scaleY = scaleX;\n    }\n\n    var gameObject = this.body.gameObject;\n\n    if (gameObject) {\n      gameObject.setScale(scaleX, scaleY);\n      return this.setBodySize(gameObject.width * gameObject.scaleX, gameObject.height * gameObject.scaleY);\n    } else {\n      return this.setBodySize(this.body.size.x * scaleX, this.body.size.y * scaleY);\n    }\n  }\n};\nmodule.exports = BodyScale;","map":null,"metadata":{},"sourceType":"script"}