[changed] PartialPointerEvent to conform to Point2D
Needs ReviewPublic

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

Details

Summary

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

Diff Detail

Repository
R13 material-motion/material-motion-js
Lint
Lint OK
Unit
No Unit Test Coverage
appsforartists created this revision.Nov 1 2017, 7:04 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptNov 1 2017, 7:04 PM
Restricted Application added a project: Material Motion. · View Herald Transcript
Restricted Application added a reviewer: O3: Material JavaScript platform reviewers. · View Herald Transcript
Restricted Application added a reviewer: Material Motion. · View Herald Transcript
Restricted Application failed to build Restricted Buildable!Nov 1 2017, 9:51 PM
Restricted Application completed building Restricted Buildable.Nov 2 2017, 1:40 PM