Skip to content

Commit 9f8e9d2

Browse files
committed
InputPlugin.processDragMove has been updated so that the resulting dragX and dragY values, sent to the event handler, now compensate for the scale of the Game Objects parent container, if inside of one. This means dragging a child of a scale Container will now still drag at 'full' speed.
1 parent d41e089 commit 9f8e9d2

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
* `SpineCanvasPlugin.shutdown` would try to dispose of the `sceneRenderer`, but the property isn't set for Canvas.
1212
* `ArcadePhysics.Body.checkWorldBounds` would incorrectly report as being on the World bounds if the `blocked.none` flag had been toggled elsewhere in the Body. It now only sets if it toggles a new internal flag (thanks Pablo)
1313
* `RenderTexture.resize` wouldn't update the CanvasTexture width and height, causing the cal to draw or drawFrame to potentially distort the texture (thanks @yhwh)
14+
* `InputPlugin.processDragMove` has been updated so that the resulting `dragX` and `dragY` values, sent to the event handler, now compensate for the scale of the Game Objects parent container, if inside of one. This means dragging a child of a scale Container will now still drag at 'full' speed.
1415

1516
## Version 3.19.0 - Naofumi - 8th August 2019
1617

src/input/InputPlugin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,9 @@ var InputPlugin = new Class({
13281328
var dxRotated = dx * Math.cos(rotation) + dy * Math.sin(rotation);
13291329
var dyRotated = dy * Math.cos(rotation) - dx * Math.sin(rotation);
13301330

1331+
dxRotated *= (1 / gameObject.parentContainer.scaleX);
1332+
dyRotated *= (1 / gameObject.parentContainer.scaleY);
1333+
13311334
dragX = dxRotated + input.dragStartX;
13321335
dragY = dyRotated + input.dragStartY;
13331336
}

0 commit comments

Comments
 (0)