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
canvas zoom and scroll with mousewheel #1659
base: master
Are you sure you want to change the base?
Conversation
oh shit. |
That's just awesome! Pd badly needs a proper zoom function... |
11d9f63
to
6113a3a
Compare
"Almost" good here! |
I think it's about ready. |
i honestly don't think so. |
i wonder whether the internal zoom-state should (also) be kept as a "step" value, so it's easier to reset to this would of course totally break if the zoom-factor was changeable. |
I was thinking that the zoom factor could be saved per-patch, I mean both zoom factor and scrolling position can be seen as part of the final presentation of the patch to the user.
Maybe we could store something like a fractional log factor? e.g
etc... ? |
Actually |
yes, sthg like that.
hmm, interesting idea. what i do love about this entire PR, is that it it's totally unrelated to Pd-core, and just does all the magic on the GUI side. |
Yeah, thanks, that's what I like too. I'm dreaming of a world where Pd doesn't even know how do the objects look like on the patch... If I had more time I'd love to try recoding my entire new knob in TCL, as an exercise. I wonder what change in the core would be needed, if any. |
done. Now the depth is expressed in steps, and the actual depth is |
This PR has been brought up to date. I would appreciate it being tested in a variety of circumstances, so that we can insist to have it included. |
This PR has been updated to latest master, and debugged for MacOS and Windows. |
I already gave many thumbs up, but I haven't come around to actually test it yet. I will put this on my list and then lobby relentlessly to have this included in Pd 0.55 :) |
Firstly, thank you for this PR, I have been using it extensively for the past month. I noticed that when zooming in and out, and then going to the properties screen and clicking ok, the label and the value of a [nbx], for instance, can change a bit. Video below for reference. zoom_pr.mp4 |
Thanks for the feedback, I'll check that as soon as I can (which won't be for a good week). |
…tting zoom if needed
simplifying the MouseWheel bindings (and prepare for Ctrl-+ resp Ctrl--)
- the "Zoom New Windows" setting is now saved to {pd_guiprefs}/default_zoom.conf - the old .pdsettings::zoom is ignored - LATER: allow other default_zoom values than 0(100%) or 100(200%)
better keeping immobile the content under the mouse
(and give up trying to do it on scrolling, no working solution was found)
(except for text items and rectangular selection outline)
4643f8f
to
9b0107e
Compare
updated and rebased. |
wouldn't it be more complete/consistent if the c-side zoom logic were taken out as well? |
Of course I'm all for doing it, but let's see if it's worth the effort... |
@millerpuckette have you had a chance to test this one? |
Zoom and scroll with the mouse wheel, like most modern software.
The code is adapted from https://wiki.tcl-lang.org/page/Canvas+zooming+using+mousewheel.
It will also allow to clean up the GUI C code from every
IEMGUI_ZOOM()
occurrences and logic ;-)Note: the current zoom factor could be reported to the Pd-core side, in order to be saved to file.