Snap a (dx, dy) direction vector to the nearest 0/45/90/135° axis,
preserving the input magnitude. Used by the pen tool's Shift-constrain
affordance; reusable for any tool that wants axis/diagonal locking.
Returns (0, 0) for a zero-length input (no direction to snap).
Snap a (dx, dy) direction vector to the nearest 0/45/90/135° axis, preserving the input magnitude. Used by the pen tool's Shift-constrain affordance; reusable for any tool that wants axis/diagonal locking.
Returns (0, 0) for a zero-length input (no direction to snap).