From ae4cfaa9928b0832f53bad6c6a77c69a99b70153 Mon Sep 17 00:00:00 2001 From: heckflosse Date: Mon, 26 Nov 2018 21:00:48 +0100 Subject: [PATCH] Using mouse wheel to zoom in sometimes zooms out, fixes #5036 --- rtgui/cropwindow.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rtgui/cropwindow.cc b/rtgui/cropwindow.cc index 45372f1f5..6eac5e59d 100644 --- a/rtgui/cropwindow.cc +++ b/rtgui/cropwindow.cc @@ -275,6 +275,10 @@ void CropWindow::scroll (int state, GdkScrollDirection direction, int x, int y, } else { delta = deltaY; } + if (delta == 0.0 && direction == GDK_SCROLL_SMOOTH) { + // sometimes this case happens. To avoid zooming into the wrong direction in this case, we just do nothing + return; + } bool isUp = direction == GDK_SCROLL_UP || (direction == GDK_SCROLL_SMOOTH && delta < 0.0); if ((state & GDK_CONTROL_MASK) && onArea(ColorPicker, x, y)) { // resizing a color picker