mirror of
https://github.com/photonstorm/phaser
synced 2024-11-28 07:31:11 +00:00
Merge pull request #5218 from braindx/drag-transform-fix
Fix drag coordinates with camera zoom (issue #4755)
This commit is contained in:
commit
bc0c289550
1 changed files with 6 additions and 6 deletions
|
@ -1126,8 +1126,8 @@ var InputPlugin = new Class({
|
|||
input.dragStartX = gameObject.x;
|
||||
input.dragStartY = gameObject.y;
|
||||
|
||||
input.dragStartXGlobal = pointer.x;
|
||||
input.dragStartYGlobal = pointer.y;
|
||||
input.dragStartXGlobal = pointer.worldX;
|
||||
input.dragStartYGlobal = pointer.worldY;
|
||||
|
||||
input.dragX = input.dragStartXGlobal - input.dragStartX;
|
||||
input.dragY = input.dragStartYGlobal - input.dragStartY;
|
||||
|
@ -1330,13 +1330,13 @@ var InputPlugin = new Class({
|
|||
|
||||
if (!gameObject.parentContainer)
|
||||
{
|
||||
dragX = pointer.x - input.dragX;
|
||||
dragY = pointer.y - input.dragY;
|
||||
dragX = pointer.worldX - input.dragX;
|
||||
dragY = pointer.worldY - input.dragY;
|
||||
}
|
||||
else
|
||||
{
|
||||
var dx = pointer.x - input.dragStartXGlobal;
|
||||
var dy = pointer.y - input.dragStartYGlobal;
|
||||
var dx = pointer.worldX - input.dragStartXGlobal;
|
||||
var dy = pointer.worldY - input.dragStartYGlobal;
|
||||
|
||||
var rotation = gameObject.getParentRotation();
|
||||
|
||||
|
|
Loading…
Reference in a new issue