diff options
author | Alexander Larsson <alexl@redhat.com> | 2004-11-29 14:15:41 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2004-11-29 14:15:41 +0000 |
commit | 490a9fe90f6eee060f2792c40f8553b4833112fd (patch) | |
tree | e5a335a454d66e1c4a59180dbed93af0099365d3 /libnautilus-private | |
parent | 51157244a6104712815de654ad06fcd0a4b11da8 (diff) | |
download | nautilus-490a9fe90f6eee060f2792c40f8553b4833112fd.tar.gz |
Fix positioning. Makes find_new_empty_spot tighter. Patch from Jimmy Do
2004-11-29 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-container.c:
(canvas_position_to_grid_position):
Fix positioning. Makes find_new_empty_spot tighter.
Patch from Jimmy Do <crispyleaves@gmail.com>
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index 5704dc61c..a4883e834 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -1265,23 +1265,20 @@ canvas_position_to_grid_position (PlacementGrid *grid, ArtIRect canvas_position, ArtIRect *grid_position) { - /* The first bit of this block will identify all intersections - * that the icon actually crosses. The second bit will mark - * any intersections that the icon is adjacent to. - * The first causes minimal moving around during a snap, but + /* The first causes minimal moving around during a snap, but * can end up with partially overlapping icons. The second one won't * allow any overlapping, but can cause more movement to happen * during a snap. */ if (grid->tight) { grid_position->x0 = ceil ((double)(canvas_position.x0 - DESKTOP_PAD_HORIZONTAL) / SNAP_SIZE_X); grid_position->y0 = ceil ((double)(canvas_position.y0 - DESKTOP_PAD_VERTICAL) / SNAP_SIZE_Y); - grid_position->x1 = floor ((double)(canvas_position.x1 - DESKTOP_PAD_HORIZONTAL) / SNAP_SIZE_X); + grid_position->x1 = floor ((double)(canvas_position.x1 - DESKTOP_PAD_HORIZONTAL) / SNAP_SIZE_X); grid_position->y1 = floor ((double)(canvas_position.y1 - DESKTOP_PAD_VERTICAL) / SNAP_SIZE_Y); } else { grid_position->x0 = floor ((double)(canvas_position.x0 - DESKTOP_PAD_HORIZONTAL) / SNAP_SIZE_X); grid_position->y0 = floor ((double)(canvas_position.y0 - DESKTOP_PAD_VERTICAL) / SNAP_SIZE_Y); - grid_position->x1 = ceil ((double)(canvas_position.x1 - DESKTOP_PAD_HORIZONTAL) / SNAP_SIZE_X); - grid_position->y1 = ceil ((double)(canvas_position.y1 - DESKTOP_PAD_VERTICAL) / SNAP_SIZE_Y); + grid_position->x1 = floor ((double)(canvas_position.x1 - DESKTOP_PAD_HORIZONTAL) / SNAP_SIZE_X); + grid_position->y1 = floor ((double)(canvas_position.y1 - DESKTOP_PAD_VERTICAL) / SNAP_SIZE_Y); } grid_position->x0 = CLAMP (grid_position->x0, 0, grid->num_columns - 1); |