soroban-abacus-flashcards/apps
Thomas Hallock fc08b775db fix: eliminate cursor dampening lag when changing direction
Fix cursor dampening feedback loop that caused lag when reversing mouse direction. The previous implementation tracked the dampened position, creating momentum/lag when changing direction.

Changes:
- Split lastCursorRef into two separate refs:
  - lastRawCursorRef: tracks actual raw mouse position
  - dampenedCursorRef: tracks current dampened position
- Calculate delta from raw-to-raw (not dampened-to-raw)
- Direction changes now respond instantly, just at reduced speed
- No more "continuation" effect when reversing direction

Technical details:
- Velocity calculation now uses raw positions for accuracy
- First frame of precision mode initializes dampened cursor at raw position
- Both refs reset on mouse leave
- Debug logging updated to show both raw and dampened positions

Result: Cursor dampening feels responsive and precise, no lag when changing direction.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-19 18:06:34 -06:00
..
web fix: eliminate cursor dampening lag when changing direction 2025-11-19 18:06:34 -06:00