This adds some inertia on the color and stone picker wheels.
Simplified the calculation of the drag point's polar angle
The previous pin state has become the valueAtStart ref. It snapshots the rotation value at the moment of mousedown when starting a new drag. If no animation is ongoing it's the value prop, if an inertia spin is running we need to read the current spring value.
For calculating the drag velocity vector at release, we take the absolute velocity vector provided by the useDrag hook and reconstruct the respective signs from the movement vector.
This adds some inertia on the color and stone picker wheels.
Simplified the calculation of the drag point's polar angle
The previous
pin
state has become thevalueAtStart
ref. It snapshots the rotation value at the moment of mousedown when starting a new drag. If no animation is ongoing it's thevalue
prop, if an inertia spin is running we need to read the current spring value.For calculating the drag velocity vector at release, we take the absolute velocity vector provided by the
useDrag
hook and reconstruct the respective signs from the movement vector.