fix inverse zoom factors
This commit is contained in:
@@ -697,10 +697,15 @@ void Plot::wheelEvent(QWheelEvent *event) {
|
||||
x += GraphStart;
|
||||
// event->angleDelta doesn't exist in QT4, both exist in 5.12.8 and 5.14.2 and event->delta doesn't exist in 5.15.0
|
||||
#if QT_VERSION >= 0x050d00
|
||||
Zoom(1.0 - (float)event->angleDelta().y() / (120 / zoom_offset), x);
|
||||
float delta = event->angleDelta().y();
|
||||
#else
|
||||
Zoom(1.0 - (float)event->delta() / (120 / zoom_offset), x);
|
||||
float delta = event->delta();
|
||||
#endif
|
||||
if (delta < 0) {
|
||||
Zoom(1.0 - (float)delta / (120 / zoom_offset), x);
|
||||
} else {
|
||||
Zoom(1.0 / (1.0 + (float)delta / (120 / zoom_offset)), x);
|
||||
}
|
||||
} else {
|
||||
#if QT_VERSION >= 0x050d00
|
||||
Move(PageWidth * (-(float)event->angleDelta().y() / (120 / move_offset)));
|
||||
|
||||
Reference in New Issue
Block a user