Skip to content

Commit 5d8b22c

Browse files
committed
Removed un-needed divide by zero check and renamed updateOrigin to updateDisplayOrigin to better reflect what it does
1 parent e395ac6 commit 5d8b22c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

v3/src/gameobjects/components/Origin.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var Origin = {
2121
set: function (value)
2222
{
2323
this._displayOriginX = value;
24-
this.originX = (value === 0) ? 0 : value / this.width;
24+
this.originX = value / this.width;
2525
}
2626

2727
},
@@ -36,7 +36,7 @@ var Origin = {
3636
set: function (value)
3737
{
3838
this._displayOriginY = value;
39-
this.originY = (value === 0) ? 0 : value / this.height;
39+
this.originY = value / this.height;
4040
}
4141

4242
},
@@ -49,7 +49,7 @@ var Origin = {
4949
this.originX = x;
5050
this.originY = y;
5151

52-
return this.updateOrigin();
52+
return this.updateDisplayOrigin();
5353
},
5454

5555
setDisplayOrigin: function (x, y)
@@ -63,7 +63,7 @@ var Origin = {
6363
return this;
6464
},
6565

66-
updateOrigin: function ()
66+
updateDisplayOrigin: function ()
6767
{
6868
this._displayOriginX = Math.round(this.originX * this.width);
6969
this._displayOriginY = Math.round(this.originY * this.height);

0 commit comments

Comments
 (0)