Skip to content

Commit 2ee50d0

Browse files
committed
InputHandler now uses localToGlobal conversion for scaled responsive layers.
1 parent b0e96a3 commit 2ee50d0

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/input/InputHandler.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1268,15 +1268,12 @@ Phaser.InputHandler.prototype = {
12681268
if (this.dragFromCenter)
12691269
{
12701270
var bounds = this.sprite.getBounds();
1271+
12711272
this.sprite.x = this.globalToLocalX(pointer.x) + (this.sprite.x - bounds.centerX);
12721273
this.sprite.y = this.globalToLocalY(pointer.y) + (this.sprite.y - bounds.centerY);
1273-
// this._dragPoint.setTo(this.sprite.x - pointer.x, this.sprite.y - pointer.y);
12741274
}
1275-
// else
1276-
// {
1277-
// this._dragPoint.setTo(this.sprite.x - pointer.x, this.sprite.y - pointer.y);
1278-
this._dragPoint.setTo(this.sprite.x - this.globalToLocalX(pointer.x), this.sprite.y - this.globalToLocalY(pointer.y));
1279-
// }
1275+
1276+
this._dragPoint.setTo(this.sprite.x - this.globalToLocalX(pointer.x), this.sprite.y - this.globalToLocalY(pointer.y));
12801277
}
12811278

12821279
this.updateDrag(pointer);

0 commit comments

Comments
 (0)