Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preference for zoom scaling #2407

Closed
j-jasz opened this issue Mar 8, 2025 · 4 comments
Closed

Preference for zoom scaling #2407

j-jasz opened this issue Mar 8, 2025 · 4 comments

Comments

@j-jasz
Copy link

j-jasz commented Mar 8, 2025

With multitude of display resolutions and hardware options like flying mouse wheels (MX Master for example) and future mobile version of Graphite it would be good to have more control of how viewport zoom levels behave.

This is a known issue in other 2D applications as well: https://krita-artists.org/t/smooth-zoom-with-mouse-wheel/31011
In the above example of Krita it was solved by adding to the preference an option to set multiplier for zoom steps.
For version 5.2.9 it can be set in: Settings -> Configure Krita -> General -> Tools -> Zoom steps between powers of 2

@0HyperCube
Copy link
Member

Thanks for reporting @j-jasz. Using ctrl + scroll works by a multiplier of the scroll delta reported to us by the browser from the WheelEvent's deltaY.

let scroll = ipp.mouse.scroll_delta.scroll_delta();
let mut zoom_factor = 1. + scroll.abs() * VIEWPORT_ZOOM_WHEEL_RATE;

I am not familiar with the «MX Master». However I assume that your browser is rounding the scroll delta. I'm not sure if there is a way to avoid this. To confirm that this is the case, please try the wheel event demo from mdn and check if you still see the rounded deltas.

An alternative approach to zoom smoothly is to use the navigate tool and drag the mouse up and down.

I'll close this since I don't really see any way that Graphite could better deal with this.

@0HyperCube 0HyperCube closed this as not planned Won't fix, can't repro, duplicate, stale Mar 8, 2025
@j-jasz
Copy link
Author

j-jasz commented Mar 8, 2025

Fair enough. If the interaction is decided by a browser limitation, then I get why its not possible.
Perhaps this could be revisited in the more distant future with the desktop app?

By the way MX Master is a mouse from Logitech. It is widely used by digital creators and it has flying wheel that allows for scrolling really, really fast without intermediate snapping. I believe this function is also in different mouse models.

@0HyperCube
Copy link
Member

If we end up writing a native desktop app then I guess that would avoid any modifications done by the browser to the scroll delta.

In the meantime I guess we could allow the user to customise the VIEWPORT_ZOOM_WHEEL_RATE to change the zoom rate. Would you find that useful @j-jasz?

@j-jasz
Copy link
Author

j-jasz commented Mar 8, 2025

Yes that would be fantastic! As long as this would not impact other areas outside of the viewport where the scrolling is used.
I was thinking about simple multiplication by a value between 0-1 in the preferences?
Also this is a pure 'quality of life' feature from my perspective so I understand completely if you have more important things to work on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants