Conversation
|
Thanks for this! Wheel events are somewhat notorious to get 'right'; empirical numbers are fine :) MacOS indeed does wheel events somewhat funny, scaling much harder if you yank the wheel harder. I guess this is a good thing, because it means people will very naturally adjust to whatever gain we put in 🤷 I looked into the wx wheel props, and I think we should just ignore the delta altogether. Then the gain is simply 1 for Windows. For MacOS a gain of 1 feels too slpw, but a gain of about 2 makes it more similar to qt. Have you tried on Linux? I could have a look tomorrow. |
|
BTW: do people still use wx nowadays? |
|
I don't :) however... a well-used application in the bioimage community is cell-profiler: https://cellprofiler.org/ (https://github.com/CellProfiler/CellProfiler) ... and they have been working on integrating ndv specifically because it supports wx. (i believe it's for licensing reasons). So, it remains an important target for ndv |
i have not! |
Oh, there don't seem to be binary wheels for wx for Linux; they expect you to built it yourself, but I don't feel like going into that rabbit hole right now, so I'm just going to assume the behavior for Linux and Windows are similar. Could you just drop the delta, and use a small gain for |
hey @almarklein
this is a fix for scrolling on windows in wx, which is currently broken (see pyapp-kit/ndv#116), but it will also slightly change the behavior on macos.
I tried to figure out what the "proper" fix is here, but the docs weren't super helpful. So the numbers I came to here are a bit empirical ... after testing on both mac and windows, to match the experience of the qt backend.
The one thing I'm confident about is that the previous code of
dy = delta * rotationis definitely wrong. It worked ok on macos because you get numbers likedelta=10, rotation=1, but on windows you getdelta=120, rotation=120and that leads to the "galaxy far away" phenotype described in the issue above (one step on the wheel and you're absolutely gone).So, I'm confident that it needs to be scaled by rotation / delta. But that leads to an extremely slow scroll. So I'm adding a gain. the 120 (on windows) exactly matches the Qt single wheel behavior, and on windows, scrolling the wheel faster simply emits more events at exactly the same rotation size. On macos, however, faster scrolling leads to dramatically different rotation sizes (which is nice for UX: you get fine control at small speed and big change at high speed).
Anyway, I know the magic number doesn't feel great here. So feel free to test/research however you like. But I'm confident that things are fully broken on main for windows + wx.