[gnome-control-center/wip/datetime-redesign: 2/13] datetime: Alignment fixes for the location marker on timezone map



commit 60061cda2b29ab6a9222e2f08bec256456278075
Author: Kalev Lember <kalevlember gmail com>
Date:   Sat Aug 17 05:13:57 2013 -0800

    datetime: Alignment fixes for the location marker on timezone map
    
    Make sure the marker is drawn pixel-aligned to avoid fuzziness, and
    ensure that it actually ends up in the visible area.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=706253

 panels/datetime/cc-timezone-map.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/panels/datetime/cc-timezone-map.c b/panels/datetime/cc-timezone-map.c
index 3e127b0..91ffaeb 100644
--- a/panels/datetime/cc-timezone-map.c
+++ b/panels/datetime/cc-timezone-map.c
@@ -388,8 +388,8 @@ cc_timezone_map_draw (GtkWidget *widget,
       pointx = convert_longtitude_to_x (priv->location->longitude, alloc.width);
       pointy = convert_latitude_to_y (priv->location->latitude, alloc.height);
 
-      if (pointy > alloc.height)
-        pointy = alloc.height;
+      pointx = CLAMP (floor (pointx), 0, alloc.width);
+      pointy = CLAMP (floor (pointy), 0, alloc.height);
 
       if (pin)
         {


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