diff options
author | Andy Hertzfeld <andy@src.gnome.org> | 2001-01-27 01:06:08 +0000 |
---|---|---|
committer | Andy Hertzfeld <andy@src.gnome.org> | 2001-01-27 01:06:08 +0000 |
commit | 3968d02a5e5eedc65abd27a76cfca055daf0794a (patch) | |
tree | 1416db0dc2fe7869fa0db7e74a3bc85272e650fd /libnautilus-extensions/nautilus-icon-dnd.c | |
parent | 5dfee0c35d7091873a30c0c63cfcb0b5cec3e6cf (diff) | |
download | nautilus-3968d02a5e5eedc65abd27a76cfca055daf0794a.tar.gz |
fixed bug 5750, accepting drops by folders quirky at zoom levels below
* libnautilus-extensions/nautilus-icon-dnd.c:
(nautilus_icon_container_item_at):
fixed bug 5750, accepting drops by folders quirky at zoom levels
below 100%. The problem was that nautilus_icon_container_item_at
was constructing a single pixel rectangle for hit-testing, that
sometimes turned into a zero pixel rectangle when scaled down,
depending on how things rounded off. Fixed by using the
canvas scale factor when building the rectangle, ensuring that
it never becomes empty.
Diffstat (limited to 'libnautilus-extensions/nautilus-icon-dnd.c')
-rw-r--r-- | libnautilus-extensions/nautilus-icon-dnd.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libnautilus-extensions/nautilus-icon-dnd.c b/libnautilus-extensions/nautilus-icon-dnd.c index 3e4f3da14..f249fa24a 100644 --- a/libnautilus-extensions/nautilus-icon-dnd.c +++ b/libnautilus-extensions/nautilus-icon-dnd.c @@ -492,13 +492,18 @@ nautilus_icon_container_item_at (NautilusIconContainer *container, int x, int y) { GList *p; + int size; ArtDRect point; - /* hit test a single pixel rectangle */ + /* build the hit-test rectangle. Base the size on the scale factor to ensure that it is + * non-empty even at the smallest scale factor + */ + + size = MAX (1, 1 + (1 / GNOME_CANVAS (container)->pixels_per_unit)); point.x0 = x; point.y0 = y; - point.x1 = x + 1; - point.y1 = y + 1; + point.x1 = x + size; + point.y1 = y + size; for (p = container->details->icons; p != NULL; p = p->next) { NautilusIcon *icon; |