libtimezonemap/0014-Fix-convert_longtitude_to_x-for-points-on-the-far-ri.patch
David Shea 51a02b6c80 Update the map data and improve behavior:
- Render the map directly from SVG (#1335158)
- Fix memory leaks in tz.c
- Fix an invalid memory access
- Do not modify TZ in the process environment
- Move all data files to /usr/share/libtimezonemap from .../libtimezonemap/ui
- Add extra city data so all timezone offsets are clickable
- Move Venezuela from -04:30 to -04:00
- Fix the conversion of points just west of 180 longitude
- Remove the out-of-date Olson map data
- Update the "backward" file
- Improve the location selected when setting the timezone by name (#1322648)
- Remove an extra line in the +10:00 layer
- Move Chile back an hour
2016-06-29 14:56:01 -04:00

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