Commit Graph

7 Commits

Author SHA1 Message Date
Bruno Binet 8a9738d755 Add support for kinetic effect while dragging.
Only dragpan interaction is supported for now.

The kinetic effect use the maths below (thx @twpayne):

Rate of decay (number, must be negative) = α
Minimum velocity (pixels/millisecond) = v_min
Initial velocity (pixels/millisecond) = v₀

Velocity at time t (pixels/millisecond) =
    α⋅t
v₀⋅ℯ

Distance travelled at time t (pixels) =
   ⎛ α⋅t    ⎞
v₀⋅⎝ℯ    - 1⎠
─────────────
      α

Duration of animation (milliseconds) =
   ⎛v_min⎞
log⎜─────⎟
   ⎝  v₀ ⎠
──────────
    α

Total distance travelled (pixels) =
-v₀ + v_min
───────────
     α

Easing function =
   ⎛ α⋅duration⋅t    ⎞
v₀⋅⎝ℯ             - 1⎠
──────────────────────
     -v₀ + v_min
2013-01-29 12:39:52 +01:00
Tom Payne 9764e76975 Move pixel/coordinate matrices into frame state, remove canRotate 2013-01-14 12:46:39 +01:00
Tom Payne e837a74e00 Set panning hint in DragPanInteraction 2013-01-14 12:35:53 +01:00
Tom Payne 5d31a44c12 Implement view hints architecture 2013-01-14 12:35:53 +01:00
Éric Lemoine 927cffb2b7 Add view abstraction 2013-01-09 14:03:16 +01:00
Tom Payne 934c75bc8c Use requestRenderFrame API in interactions 2013-01-03 12:23:50 +01:00
Tom Payne e5d39724c9 Give each source file a unique name 2012-10-26 11:25:26 +02:00