[libshumate] viewport: Fix modulo in set_rotation



commit 2b479f07170d30711c67dadc044694fafff36603
Author: James Westman <james jwestman net>
Date:   Sun Aug 21 15:38:19 2022 -0500

    viewport: Fix modulo in set_rotation
    
    Fixes gnome-maps#462.

 shumate/shumate-viewport.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/shumate/shumate-viewport.c b/shumate/shumate-viewport.c
index fdb7458..8c68dbe 100644
--- a/shumate/shumate-viewport.c
+++ b/shumate/shumate-viewport.c
@@ -484,6 +484,8 @@ shumate_viewport_set_rotation (ShumateViewport *self,
   g_return_if_fail (SHUMATE_IS_VIEWPORT (self));
 
   rotation = fmod (rotation, G_PI * 2.0);
+  if (rotation < 0)
+    rotation += G_PI * 2.0;
 
   if (self->rotation == rotation)
     return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]