summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain Lane <iain.lane@canonical.com>2015-12-04 13:11:24 +0000
committerIain Lane <iain.lane@canonical.com>2015-12-04 15:02:07 +0000
commit18652bed8732d7b2978da4fcb22b88c246d27dd0 (patch)
tree55cf84ef9bda2cadf4e143f4cd1a276bc26042f1
parent8ed0bdb408a316d41afb7e990637c47972a700c9 (diff)
downloadnautilus-18652bed8732d7b2978da4fcb22b88c246d27dd0.tar.gz
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
-rw-r--r--libnautilus-private/nautilus-canvas-container.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libnautilus-private/nautilus-canvas-container.c b/libnautilus-private/nautilus-canvas-container.c
index 87ce3dd0a..84e652361 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;
}