[gnome-control-center] datetime: Alignment fixes for the location marker on timezone map



commit be79efe24268f030eba05ad9f3acc1a1d6a7a137
Author: Kalev Lember <kalevlember gmail com>
Date:   Sun Aug 18 12:13:57 2013 +0200

    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]