quadratichq / quadratic

Quadratic | Spreadsheet with Python, SQL, and AI
https://QuadraticHQ.com
Other
3.02k stars 154 forks source link

Zooming with ctrl+scrollwheel zooms in massive increments #152

Closed murtaza64 closed 1 year ago

murtaza64 commented 2 years ago

When I zoom in and out using ctrl+scroll (firefox, windows), the zoom jumps between very disparate levels (6%, 15%, 39%, 100%, 255%, 650%). It would be amazing if these changes were smoother so I could comfortably find a good zoom level using my scroll wheel as I do in many other apps (on webpages, firefox goes 10% at a time).

davidkircos commented 2 years ago

@davidfig Is this controlled bypixi-viewport ? Is it customizable?

davidfig commented 2 years ago

It might be customizable? What happens on ctrl + mouse? scroll, and what's the expected behavior?

deshumake commented 2 years ago

It's expected to scroll, it just does so by a huge amount right now

deshumake commented 2 years ago

I found a place where this can be fixed: line 44 of ViewportComponent.tsx.

44  |   .wheel({ trackpadPinch: true, wheelZoom: false, percent: 1.5 })

The "percent: 1.5" is what's causing this issue. Not sure what the actual lowest number can be, but going down to 0 still scrolls, and changes the view percent to 46 when zooming out, and 218 when zooming in. (My mouse settings are supposed to scroll 3 lines on each click)

It seems like part of the issue is the original size of the spreadsheet behind it. Can we make it like 5x bigger? That would probably let us have more control over the amount we want to scroll by