mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 20:53:39 +00:00
The dragend
event would be broadcast even if the drag distance or drag time thresholds were not met. Fix #3686
This commit is contained in:
parent
de8462efed
commit
8aa116ca4b
2 changed files with 24 additions and 19 deletions
|
@ -38,6 +38,7 @@
|
|||
* The Particle tint value was incorrectly calculated, causing the color channels to be inversed. Fix #3643 (thanks @rgk)
|
||||
* All Game Objects that were in Containers were being destroyed twice when a Scene was shutdown. Although not required it still worked in most cases, except with TileSprites. TileSprites specifically have been hardened against this now but all Game Objects inside Containers now have a different event flow, stopping them from being destroyed twice (thanks @laptou)
|
||||
* Camera.cull will now accurately return only the Game Objects in the camera's view, instead of them all. Fix #3646 (thanks @KingCosmic @Yora)
|
||||
* The `dragend` event would be broadcast even if the drag distance or drag time thresholds were not met. Fix #3686 (thanks @RollinSafary)
|
||||
|
||||
Changes the checks for Camera.cull to give only the game objects in the camera's view instead of all game objects
|
||||
|
||||
|
|
|
@ -686,7 +686,7 @@ var InputPlugin = new Class({
|
|||
}
|
||||
|
||||
// 4 = Pointer actively dragging the draglist and has moved
|
||||
if (pointer.dragState === 4 && pointer.justMoved)
|
||||
if (pointer.dragState === 4 && pointer.justMoved && !pointer.justUp)
|
||||
{
|
||||
var dropZones = this._tempZones;
|
||||
|
||||
|
@ -779,32 +779,36 @@ var InputPlugin = new Class({
|
|||
|
||||
input = gameObject.input;
|
||||
|
||||
input.dragState = 0;
|
||||
|
||||
input.dragX = input.localX - gameObject.displayOriginX;
|
||||
input.dragY = input.localY - gameObject.displayOriginY;
|
||||
|
||||
var dropped = false;
|
||||
|
||||
if (input.target)
|
||||
if (input.dragState === 2)
|
||||
{
|
||||
gameObject.emit('drop', pointer, input.target);
|
||||
input.dragState = 0;
|
||||
|
||||
this.emit('drop', pointer, gameObject, input.target);
|
||||
input.dragX = input.localX - gameObject.displayOriginX;
|
||||
input.dragY = input.localY - gameObject.displayOriginY;
|
||||
|
||||
input.target = null;
|
||||
var dropped = false;
|
||||
|
||||
dropped = true;
|
||||
if (input.target)
|
||||
{
|
||||
gameObject.emit('drop', pointer, input.target);
|
||||
|
||||
this.emit('drop', pointer, gameObject, input.target);
|
||||
|
||||
input.target = null;
|
||||
|
||||
dropped = true;
|
||||
}
|
||||
|
||||
// And finally the dragend event
|
||||
|
||||
gameObject.emit('dragend', pointer, input.dragX, input.dragY, dropped);
|
||||
|
||||
this.emit('dragend', pointer, gameObject, dropped);
|
||||
}
|
||||
|
||||
// And finally the dragend event
|
||||
|
||||
gameObject.emit('dragend', pointer, input.dragX, input.dragY, dropped);
|
||||
|
||||
this.emit('dragend', pointer, gameObject, dropped);
|
||||
}
|
||||
|
||||
pointer.dragState = 0;
|
||||
|
||||
list.splice(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue