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

Zoom without CTRL/CMD #26

Open
DasLixou opened this issue Jul 6, 2024 · 5 comments
Open

Zoom without CTRL/CMD #26

DasLixou opened this issue Jul 6, 2024 · 5 comments

Comments

@DasLixou
Copy link

DasLixou commented Jul 6, 2024

Is your feature request related to a problem? Please describe.
I am using egui_plot to draw a plot and currently have to press ctrl/cmd in order to zoom in and out with the scroll wheel.

Describe the solution you'd like
I want to zoom in and out with the scroll wheel directly without having to press ctrl/cmd.

Describe alternatives you've considered
Somehow hacking that in myself. But this got even harder because now scrolling is done by egui and seems to be strictly coupled with ctrl/cmd.

@YgorSouza
Copy link
Contributor

We do have an example at least: https://github.com/emilk/egui/tree/0f6310c598b5be92f339c9275a00d5decd838c1b/examples/custom_plot_manipulation.

@emilk
Copy link
Owner

emilk commented Jul 7, 2024

When I drag two fingers across my trackpad, I get 2D scroll events. That should pan the plot, not zoom. I don't see how you would distinguish that from a 1D scroll action on a mouse.

@DasLixou
Copy link
Author

DasLixou commented Jul 7, 2024

When I drag two fingers across my trackpad, I get 2D scroll events. That should pan the plot, not zoom. I don't see how you would distinguish that from a 1D scroll action on a mouse.

Dragging (if that's what you mean by pan) should only be done with pressing down.
I want to recreate something that feels like Google Maps or something

@emilk
Copy link
Owner

emilk commented Jul 7, 2024

I can see why you would want that. For contrast, the Maps app on my Mac works pretty similar to egui_plots, with pinch-to-zoom and scroll-to-pan.

I guess we want to add some settings then so users can control this behavior.

@DasLixou
Copy link
Author

DasLixou commented Jul 8, 2024

How hard would that be to implement? Is that something a noobie like me could do? O.o
If winit seperates scroll on trackpad and scroll on mouse I do think it could be trivial, especially with the new egui-controlled zoom stats.

@emilk emilk transferred this issue from emilk/egui Jul 15, 2024
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

3 participants