Commit ebff3e63 authored by James Westman's avatar James Westman
Browse files

view: Fix bug when zooming in/out

The zoom_in function had a guard preventing from zooming when already at level
0 (which would cause an underflow), but this guard needs to be in zoom_out
instead.

Fixes bugs where, when you're all the way zoomed out, 1) you can't zoom in, and
2) you can zoom out and it will wrap around to the highest zoom level.
parent 05059f98
......@@ -404,9 +404,6 @@ void shumate_viewport_zoom_in (ShumateViewport *self)
{
g_return_if_fail (SHUMATE_IS_VIEWPORT (self));
if (self->zoom_level == 0)
return;
shumate_viewport_set_zoom_level (self, self->zoom_level + 1);
}
......@@ -420,6 +417,9 @@ void shumate_viewport_zoom_out (ShumateViewport *self)
{
g_return_if_fail (SHUMATE_IS_VIEWPORT (self));
if (self->zoom_level == 0)
return;
shumate_viewport_set_zoom_level (self, self->zoom_level - 1);
}
......
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