jkriege2 / JKQtPlotter

an extensive Qt5 & Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
http://jkriege2.github.io/JKQtPlotter/index.html
GNU Lesser General Public License v2.1
889 stars 190 forks source link

Problem with mouse coordinate(s) in JKQTPlotter::wheelEvent() #98

Closed fpalazzolo closed 1 year ago

fpalazzolo commented 1 year ago

Hello,

I am implementing my own custom zooming, and I'm having an issue with the mouse y coordinate that comes from here:

https://github.com/jkriege2/JKQtPlotter/blob/99408c368a749ab83fbaaf7ab261fb4be63693f4/lib/jkqtplotter/jkqtplotter.cpp#L1069

I think it should at least be p2y(wheel_y), not p2x(wheel_y), right? Also, I expected to see magnification and getPlotYOffset() in there too maybe?

Can someone review both the x and y coordinate there for correctness?

Thank you

jkriege2 commented 1 year ago

fixed via https://github.com/jkriege2/JKQtPlotter/commit/d1e493fc73dfa3f6156d7d2d7b7cee2b7e37730e ... thanks for reporting!

jkriege2 commented 1 year ago

Did this solve your Problem? I also improved handling of wheelEvents recently (especially in conjunction with track-pads), if that might be of concern to you!