Skip to content

Commit 63fb778

Browse files
committed
Fixes issue of Pixi DisplayObject width/height sending an emitter scale into Infinity.
1 parent 0ff2eb2 commit 63fb778

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

src/particles/arcade/Emitter.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,38 @@ Phaser.Particles.Arcade.Emitter.prototype.at = function (object) {
719719

720720
};
721721

722+
/**
723+
* @name Phaser.Particles.Arcade.Emitter#width
724+
* @property {number} width - Gets or sets the width of the Emitter. This is the region in which a particle can be emitted.
725+
*/
726+
Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "width", {
727+
728+
get: function () {
729+
return this.area.width;
730+
},
731+
732+
set: function (value) {
733+
this.area.width = value;
734+
}
735+
736+
});
737+
738+
/**
739+
* @name Phaser.Particles.Arcade.Emitter#height
740+
* @property {number} height - Gets or sets the height of the Emitter. This is the region in which a particle can be emitted.
741+
*/
742+
Object.defineProperty(Phaser.Particles.Arcade.Emitter.prototype, "height", {
743+
744+
get: function () {
745+
return this.area.height;
746+
},
747+
748+
set: function (value) {
749+
this.area.height = value;
750+
}
751+
752+
});
753+
722754
/**
723755
* @name Phaser.Particles.Arcade.Emitter#x
724756
* @property {number} x - Gets or sets the x position of the Emitter.

0 commit comments

Comments
 (0)