[changed] PartialPointerEvent to conform to Point2D

Authored by appsforartists on Nov 1 2017, 7:03 PM.


[changed] PartialPointerEvent to conform to Point2D

PointerEvent has x/y properties defined relative to the viewport origin and pageX/Y properties relative to the document's origin.

Originally, we were using pageX/Y, but it's easy to forget that the API is different than Point2D. (In fact, I forgot when I threw together ParallaxDemo. I got lucky and discovered the x/y properties on PointerEvent when I realized it should have been broken, but somehow worked.)

Most of the time, the distinction won't matter, since:

  • we care about deltas between points more than their absolute values,
  • users won't typically scroll during an interaction, and
  • most interactions we've built use fixed positioning (viewport-relative) anyway.

Hence, I'm using the simpler x/y now. If we ever need to build an interaction that supports user scrolling, we can add support for pageX/Y, but for now, let's do the simple thing.

Closes https://github.com/material-motion/material-motion-js/issues/237

Reviewers: O2 Material Motion, O3 Material JavaScript platform reviewers, Material Motion

Tags: Material Motion

Differential Revision: http://codereview.cc/D3442


appsforartistsJun 1 2018, 6:35 PM
Differential Revision
D3442: [changed] PartialPointerEvent to conform to Point2D
R13:d67034f30a77: [upgraded] to wobble@1.4