[libshumate] view: Fix scroll-to-zoom direction
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libshumate] view: Fix scroll-to-zoom direction
- Date: Tue, 9 Mar 2021 21:31:22 +0000 (UTC)
commit ee1dac0d6a9fa465aa8ad31af32f8b4c8938b567
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Tue Mar 9 17:28:29 2021 -0300
view: Fix scroll-to-zoom direction
The check for the scroll deltas is reversed, correct that. It's worth
noticing that we don't have to care about natural scroll, the values
are reversed when it's enabled.
Also make sure to not zoom out when dy is zero.
Fixes: https://gitlab.gnome.org/GNOME/libshumate/-/issues/4
shumate/shumate-view.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/shumate/shumate-view.c b/shumate/shumate-view.c
index 57fbb4d..9ff75fc 100644
--- a/shumate/shumate-view.c
+++ b/shumate/shumate-view.c
@@ -534,9 +534,9 @@ on_scroll_controller_scroll (ShumateView *self,
scroll_latitude = shumate_viewport_widget_y_to_latitude (priv->viewport, GTK_WIDGET (self),
priv->current_y);
}
- if (dy > 0)
+ if (dy < 0)
shumate_viewport_zoom_in (priv->viewport);
- else
+ else if (dy > 0)
shumate_viewport_zoom_out (priv->viewport);
if (map_source)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]