Skip to content

Commit 583a645

Browse files
committed
setDisplayOrigin divide by zero fix phaserjs#3066
1 parent f03a829 commit 583a645

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

v3/src/gameobjects/components/Origin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ var Origin = {
3030
this.displayOriginX = x;
3131
this.displayOriginY = y;
3232

33-
this.originX = this.width / x;
34-
this.originY = this.height / y;
33+
this.originX = (x === 0) ? 0 : this.width / x;
34+
this.originY = (y === 0) ? 0 : this.height / y;
3535

3636
return this;
3737
},

0 commit comments

Comments
 (0)