32 lines
900 B
Diff
32 lines
900 B
Diff
|
From 417cd20b127ae50ecd7d7ec793f56fb89364c28d Mon Sep 17 00:00:00 2001
|
||
|
From: David Shea <dshea@redhat.com>
|
||
|
Date: Tue, 28 Jun 2016 11:29:55 -0400
|
||
|
Subject: [PATCH 14/24] Fix convert_longtitude_to_x for points on the far
|
||
|
right.
|
||
|
|
||
|
convert_longtitude_to_x was returning negative x values for longitudes
|
||
|
between -168 and -180. Wrap these back to the right side of the map,
|
||
|
instead.
|
||
|
---
|
||
|
src/cc-timezone-map.c | 4 ++++
|
||
|
1 file changed, 4 insertions(+)
|
||
|
|
||
|
diff --git a/src/cc-timezone-map.c b/src/cc-timezone-map.c
|
||
|
index 31a4876..e64ec2b 100644
|
||
|
--- a/src/cc-timezone-map.c
|
||
|
+++ b/src/cc-timezone-map.c
|
||
|
@@ -777,6 +777,10 @@ convert_longtitude_to_x (gdouble longitude, gint map_width)
|
||
|
x = (map_width * (180.0 + longitude) / 360.0)
|
||
|
+ (map_width * xdeg_offset / 180.0);
|
||
|
|
||
|
+ /* If x is negative, wrap back to the beginning */
|
||
|
+ if (x < 0)
|
||
|
+ x = (gdouble) map_width + x;
|
||
|
+
|
||
|
return x;
|
||
|
}
|
||
|
|
||
|
--
|
||
|
2.5.5
|
||
|
|