[added] Point2DSpring
ClosedPublic

Authored by appsforartists on Oct 3 2017, 11:21 PM.

Details

Summary

Point2DSpring is composed of an independent spring on each axis. It handles the boilerplate of deconstructing and recombining points into numbers, and feeding those values into the underlying springs.

Because it is composed of independent springs, it will dispatch when either changes. If both are changing, this could be twice per frame. It should probably be _debounced, but that adds complexity to state$ (because would need to wait until the next frame before setting itself to rest). For now, I'm punting on that complexity. In practice, an overly chatty spring shouldn't matter that much. If it doesn, authors can always call _debounce() themselves until I get around to adding that coordination in Point2DSpring.

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

Diff Detail

Repository
R13 material-motion/material-motion-js
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
appsforartists created this revision.Oct 3 2017, 11:21 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptOct 3 2017, 11:21 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 completed building Restricted Buildable.Oct 3 2017, 11:24 PM
featherless accepted this revision.Oct 6 2017, 1:53 PM
This revision is now accepted and ready to land.Oct 6 2017, 1:53 PM
This revision was automatically updated to reflect the committed changes.