Rebasing on dev to get MockPointer changes for #3375 (#3546)
* Fix issue #2662 Added a touch counter instead of flag to ensure the correct touch count

* See #2662 --- bending to the will of eslint

* See #2662 --- Added _touchCount to interactiveTarget.js, and removed an extraneous line in InteractionManager.js

* Removed an unnecessary check for _touchCount === undefined, since the mixin for interactiveTarget will always set this

* Fix issue #2662 Added a touch counter instead of flag to ensure the correct touch count

* See #2662 --- bending to the will of eslint

* See #2662 --- Added _touchCount to interactiveTarget.js, and removed an extraneous line in InteractionManager.js

* Removed an unnecessary check for _touchCount === undefined, since the mixin for interactiveTarget will always set this

* Adding cancel events to interaction manager

* Refactoring InteractionManager to normalize all events to PointerEvents. Also updated InteractiveTarget to handle multiple touch or pointer events by recording pointerId for all tracked events, rather than just counting events. Finally, InteractionManager now updates on all tracked events, rather than just mouse events, so it should send move events when UI objects move underneath any held event, not just the mouse

* Typo: mouse is not a function

* InteractionManager normalizeToPointerData now returns an array of normalized events for TouchEvents with multiple changedtouches

* Typo: no such thing as onPointerStart

* Fixing some more typos: trying to read the pointerId of un-normalized events

* Typos: un-normalized events don't have a pointerType

* Added identifier property to InteractionData, and got rid of some typos---trying to read pointerId from un-normalized events

* Forgot to bind onPointerCancel

* Refactoring interactiveTarget.js a bit, so that over, left down and right down are pointer properties, not mouse properties.

* Forgot an export default

* Changed the mixin pattern for Pixi.interaction.interactiveTarget, so that this is bound correctly, so that DisplayObjects can each get a unique object for tracking pointers

* Fixed some typos, moved interactiveTarget back to being an object, and released InteractionData after touch up/cancelled events

* Small fixed

* Safari compatibility

* hasOwnProperty fix

* Safer to use a string for mouse pointer than a number

* InteractionManager should now handle native DOM pointer events with pointerType mouse or touch by emitting mouse and touch events, respectively

* InteractionManager test now respects the refactored spec for InteractionManager

* Pointer events exclusive

* String.startsWith is not available in all browsers esp. older version of Safari. As it's just used in one place we can use a RegExp here too

* Moving from regex, slightly faster

* See #3149 --- Add support for touchcancel and pointercancel (#3375)

* Fix issue #2662 Added a touch counter instead of flag to ensure the correct touch count

* See #2662 --- bending to the will of eslint

* See #2662 --- Added _touchCount to interactiveTarget.js, and removed an extraneous line in InteractionManager.js

* Removed an unnecessary check for _touchCount === undefined, since the mixin for interactiveTarget will always set this

* Fix issue #2662 Added a touch counter instead of flag to ensure the correct touch count

* See #2662 --- bending to the will of eslint

* See #2662 --- Added _touchCount to interactiveTarget.js, and removed an extraneous line in InteractionManager.js

* Removed an unnecessary check for _touchCount === undefined, since the mixin for interactiveTarget will always set this

* Adding cancel events to interaction manager

* Refactoring InteractionManager to normalize all events to PointerEvents. Also updated InteractiveTarget to handle multiple touch or pointer events by recording pointerId for all tracked events, rather than just counting events. Finally, InteractionManager now updates on all tracked events, rather than just mouse events, so it should send move events when UI objects move underneath any held event, not just the mouse

* Typo: mouse is not a function

* InteractionManager normalizeToPointerData now returns an array of normalized events for TouchEvents with multiple changedtouches

* Typo: no such thing as onPointerStart

* Fixing some more typos: trying to read the pointerId of un-normalized events

* Typos: un-normalized events don't have a pointerType

* Added identifier property to InteractionData, and got rid of some typos---trying to read pointerId from un-normalized events

* Forgot to bind onPointerCancel

* Refactoring interactiveTarget.js a bit, so that over, left down and right down are pointer properties, not mouse properties.

* Forgot an export default

* Changed the mixin pattern for Pixi.interaction.interactiveTarget, so that this is bound correctly, so that DisplayObjects can each get a unique object for tracking pointers

* Fixed some typos, moved interactiveTarget back to being an object, and released InteractionData after touch up/cancelled events

* Small fixed

* Safari compatibility

* hasOwnProperty fix

* Safer to use a string for mouse pointer than a number

* InteractionManager should now handle native DOM pointer events with pointerType mouse or touch by emitting mouse and touch events, respectively

* InteractionManager test now respects the refactored spec for InteractionManager

* Pointer events exclusive

* String.startsWith is not available in all browsers esp. older version of Safari. As it's just used in one place we can use a RegExp here too

* Moving from regex, slightly faster

* Fixed interaction tests for the new world of pointer events
1 parent 0ab9a73 commit 18257bbde0e3d65dae251a4e6f07d2b813655329
@Sam Tarakajian Sam Tarakajian authored on 26 Jan 2017
Andrew Start committed on 26 Jan 2017
Showing 6 changed files
View
src/interaction/InteractionData.js
View
src/interaction/InteractionEvent.js
View
src/interaction/InteractionManager.js
View
src/interaction/InteractionTrackingData.js 0 → 100644
View
src/interaction/interactiveTarget.js
View
test/interaction/MockPointer.js