[libshumate] viewport: Clamp zoom level after updating min/max levels
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libshumate] viewport: Clamp zoom level after updating min/max levels
- Date: Thu, 4 Mar 2021 20:34:50 +0000 (UTC)
commit a71cb31c325eea58ba83d266f598d3c0eccb8b6d
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Mar 4 13:09:26 2021 -0300
viewport: Clamp zoom level after updating min/max levels
It currently doesn't make a difference, but shumate_viewport_set_zoom_level()
reads min and max zoom levels, and it's being called with the old values.
shumate/shumate-viewport.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/shumate/shumate-viewport.c b/shumate/shumate-viewport.c
index 1d0bbf9..c7191e0 100644
--- a/shumate/shumate-viewport.c
+++ b/shumate/shumate-viewport.c
@@ -343,11 +343,11 @@ shumate_viewport_set_max_zoom_level (ShumateViewport *self,
if (self->max_zoom_level == max_zoom_level)
return;
- if (self->zoom_level > max_zoom_level)
- shumate_viewport_set_zoom_level (self, max_zoom_level);
-
self->max_zoom_level = max_zoom_level;
g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_MAX_ZOOM_LEVEL]);
+
+ if (self->zoom_level > max_zoom_level)
+ shumate_viewport_set_zoom_level (self, max_zoom_level);
}
/**
@@ -382,11 +382,11 @@ shumate_viewport_set_min_zoom_level (ShumateViewport *self,
if (self->min_zoom_level == min_zoom_level)
return;
- if (self->zoom_level < min_zoom_level)
- shumate_viewport_set_zoom_level (self, min_zoom_level);
-
self->min_zoom_level = min_zoom_level;
g_object_notify_by_pspec (G_OBJECT (self), obj_properties[PROP_MIN_ZOOM_LEVEL]);
+
+ if (self->zoom_level < min_zoom_level)
+ shumate_viewport_set_zoom_level (self, min_zoom_level);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]