From 01ca4293e44bd6a6e8369e6a2941e6e357cca34a Mon Sep 17 00:00:00 2001 From: samme Date: Wed, 8 Jul 2020 12:04:23 -0700 Subject: [PATCH] Fix missing _crop property Fixes #5211 --- src/physics/matter-js/MatterImage.js | 10 ++++++++++ src/physics/matter-js/MatterSprite.js | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/physics/matter-js/MatterImage.js b/src/physics/matter-js/MatterImage.js index 0184cae22..5c226f3d4 100644 --- a/src/physics/matter-js/MatterImage.js +++ b/src/physics/matter-js/MatterImage.js @@ -86,6 +86,16 @@ var MatterImage = new Class({ { GameObject.call(this, world.scene, 'Image'); + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.Physics.Matter.Image#_crop + * @type {object} + * @private + * @since 3.24.0 + */ + this._crop = this.resetCropObject(); + this.setTexture(texture, frame); this.setSizeToFrame(); this.setOrigin(); diff --git a/src/physics/matter-js/MatterSprite.js b/src/physics/matter-js/MatterSprite.js index e04ed61fa..3b0e53a2b 100644 --- a/src/physics/matter-js/MatterSprite.js +++ b/src/physics/matter-js/MatterSprite.js @@ -90,6 +90,16 @@ var MatterSprite = new Class({ { GameObject.call(this, world.scene, 'Sprite'); + /** + * The internal crop data object, as used by `setCrop` and passed to the `Frame.setCropUVs` method. + * + * @name Phaser.Physics.Matter.Sprite#_crop + * @type {object} + * @private + * @since 3.24.0 + */ + this._crop = this.resetCropObject(); + this.anims = new AnimationComponent(this); this.setTexture(texture, frame);