Skip to content

Commit 36f08d8

Browse files
committed
The processDomCallbacks method in the Input Manager wasn't correctly clearing the once arrays. Responsibility for this has now been passed to the queue methods queueTouchStart, queueTouchMove, queueTouchEnd, queueMouseDown, queueMouseMove and queueMouseUp. Fix phaserjs#4257
1 parent bb4ecc6 commit 36f08d8

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ one set of bindings ever created, which makes things a lot cleaner.
252252
* Fixed an issue where changing the viewport or size of a Camera belonging to a RenderTexture wouldn't impact the rendering and objects will still render outside of the viewport range. It's now converted to a proper gl scissor rect by the renderer, meaning you can limit the area rendered to by adjusting the internal Render Texture cameras viewport. Fix #4243 (thanks @hackhat)
253253
* `CanvasTexture.destroy` is a new method that specifically handles the destruction of the CanvasTexture and all of its associated typed arrays. This prevents a memory leak when creating and destroying lots of RenderTextures (which are CanvasTexture backed). Fix #4239 (thanks @sjb933)
254254
* The Alpha, Flip and Origin components have been removed from the Mesh Game Object (and by extension, Quad as well) as they are not used in the renderer and should be manipulated via the Mesh properties. Fix #4188 (thanks @enriqueto)
255+
* The `processDomCallbacks` method in the Input Manager wasn't correctly clearing the `once` arrays. Responsibility for this has now been passed to the queue methods `queueTouchStart`, `queueTouchMove`, `queueTouchEnd`, `queueMouseDown`, `queueMouseMove` and `queueMouseUp`. Fix #4257 (thanks @iArePJ)
255256

256257
### Examples and TypeScript
257258

src/input/InputManager.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,6 @@ var InputManager = new Class({
885885
every[i](event);
886886
}
887887

888-
once = [];
889-
890888
return (every.length > 0);
891889
},
892890

@@ -909,6 +907,8 @@ var InputManager = new Class({
909907
var callbacks = this.domCallbacks;
910908

911909
this._hasDownCallback = this.processDomCallbacks(callbacks.downOnce, callbacks.down, event);
910+
911+
callbacks.downOnce = [];
912912
}
913913
},
914914

@@ -931,6 +931,8 @@ var InputManager = new Class({
931931
var callbacks = this.domCallbacks;
932932

933933
this._hasMoveCallback = this.processDomCallbacks(callbacks.moveOnce, callbacks.move, event);
934+
935+
callbacks.moveOnce = [];
934936
}
935937
},
936938

@@ -953,6 +955,8 @@ var InputManager = new Class({
953955
var callbacks = this.domCallbacks;
954956

955957
this._hasUpCallback = this.processDomCallbacks(callbacks.upOnce, callbacks.up, event);
958+
959+
callbacks.upOnce = [];
956960
}
957961
},
958962

@@ -990,6 +994,8 @@ var InputManager = new Class({
990994
var callbacks = this.domCallbacks;
991995

992996
this._hasDownCallback = this.processDomCallbacks(callbacks.downOnce, callbacks.down, event);
997+
998+
callbacks.downOnce = [];
993999
}
9941000
},
9951001

@@ -1012,6 +1018,8 @@ var InputManager = new Class({
10121018
var callbacks = this.domCallbacks;
10131019

10141020
this._hasMoveCallback = this.processDomCallbacks(callbacks.moveOnce, callbacks.move, event);
1021+
1022+
callbacks.moveOnce = [];
10151023
}
10161024
},
10171025

@@ -1034,6 +1042,8 @@ var InputManager = new Class({
10341042
var callbacks = this.domCallbacks;
10351043

10361044
this._hasUpCallback = this.processDomCallbacks(callbacks.upOnce, callbacks.up, event);
1045+
1046+
callbacks.upOnce = [];
10371047
}
10381048
},
10391049

0 commit comments

Comments
 (0)