Commit 8f309330 authored by Georges Basile Stavracas Neto's avatar Georges Basile Stavracas Neto
Browse files

viewport: Validate min and max zoom levels

They must not contradict each other, e.g. max zoom level smaller
than the min zoom level.
parent 4753726e
......@@ -339,6 +339,7 @@ shumate_viewport_set_max_zoom_level (ShumateViewport *self,
guint max_zoom_level)
{
g_return_if_fail (SHUMATE_IS_VIEWPORT (self));
g_return_if_fail (max_zoom_level >= self->min_zoom_level);
if (self->max_zoom_level == max_zoom_level)
return;
......@@ -378,6 +379,7 @@ shumate_viewport_set_min_zoom_level (ShumateViewport *self,
guint min_zoom_level)
{
g_return_if_fail (SHUMATE_IS_VIEWPORT (self));
g_return_if_fail (min_zoom_level <= self->max_zoom_level);
if (self->min_zoom_level == min_zoom_level)
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment