qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.62k stars 218 forks source link

Improve trackpad scrolling precision #938

Closed tsung-ju closed 2 years ago

tsung-ju commented 2 years ago

Hi! This is an attempt to improve handling of trackpad scrolling in NvimView.

The idea is to simulate 1:1 scrolling by dividing the scroll delta by cellSize.height, and keep the remainder in a counter for the next iteration. This works better than taking ceil, especially when the scrolling speed is slower.

I have also temporarily removed trackpadScrollResistance from the calculation, as the scrolling speed no longer feels too fast to me after these changes.

qvacua commented 2 years ago

Thanks, it's much nicer now. I just added a small comment; after that change, I'll merge and remove the pref for sensitivity.