[nautilus] canvas-container: consider margins when calculating icon bounding box



commit 846085ade99159ecf429aeb5f9223d075bf059c5
Author: Iain Lane <iain lane canonical com>
Date:   Fri Dec 4 13:11:24 2015 +0000

    canvas-container: consider margins when calculating icon bounding box
    
    Shells can fix docks, panels and other similar things which reduce the
    available space to draw on. This is called the canvas margin.
    
    When positioning things relative to icons within containers we need to
    adjust by this margin, otherwise they will be shifted away from the
    target. Do this when we calculate the bounding box.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=759002

 libnautilus-private/nautilus-canvas-container.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c
index 87ce3dd..84e6523 100644
--- a/libnautilus-private/nautilus-canvas-container.c
+++ b/libnautilus-private/nautilus-canvas-container.c
@@ -6411,9 +6411,11 @@ nautilus_canvas_container_get_icons_bounding_box (NautilusCanvasContainer *conta
                icon_get_bounding_box ((NautilusCanvasIcon *)node->data,
                                        &x1, &y1, &x2, &y2,
                                       BOUNDS_USAGE_FOR_DISPLAY);
-                g_array_index (result, GdkRectangle, index).x = x1 * EEL_CANVAS (container)->pixels_per_unit;
+                g_array_index (result, GdkRectangle, index).x = x1 * EEL_CANVAS (container)->pixels_per_unit 
+
+                                                                container->details->left_margin;
                 g_array_index (result, GdkRectangle, index).width = (x2 - x1) * EEL_CANVAS 
(container)->pixels_per_unit;
-                g_array_index (result, GdkRectangle, index).y = y1 * EEL_CANVAS (container)->pixels_per_unit;
+                g_array_index (result, GdkRectangle, index).y = y1 * EEL_CANVAS (container)->pixels_per_unit 
+
+                                                                container->details->top_margin;
                 g_array_index (result, GdkRectangle, index).height = (y2 - y1) * EEL_CANVAS 
(container)->pixels_per_unit;
         }
 


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