Commit 3abb791e authored by Andy Hertzfeld's avatar Andy Hertzfeld
Browse files

made the shadow rectangles track the icons properly by adding the center


        made the shadow rectangles track the icons properly by adding the center
	offset
parent ecc10811
2000-01-28 Andy Hertzfeld <andy@eazel.com>
* libnautilus/gnome-icon-container-dnd.c:
made shadow rectangles track icons properly by adding in the center offset
2000-01-28 John Sullivan <sullivan@eazel.com>
A little zoom cleanup:
......
......@@ -198,6 +198,7 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
GtkSelectionData *selection_data)
{
GnomeIconContainerDetails *details;
GnomeCanvas* canvas = GNOME_CANVAS(container);
GList *p;
GString *data;
......@@ -206,6 +207,7 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
data = g_string_new (NULL);
for (p = details->icons; p != NULL; p = p->next) {
GnomeIconContainerIcon *icon;
gint center_offset;
char *uri;
char *s;
GdkPixbuf *pixbuf;
......@@ -215,8 +217,11 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
if (!icon->is_selected)
continue;
center_offset = nautilus_icons_view_icon_item_center_offset(icon->item);
/* Corner of the icon relative to the cursor. */
icon_x = icon->x - details->dnd_info->start_x;
icon_x = icon->x - details->dnd_info->start_x + floor(center_offset / canvas->pixels_per_unit);
icon_y = icon->y - details->dnd_info->start_y;
uri = nautilus_icons_controller_get_icon_uri (details->controller, icon->data);
......
......@@ -198,6 +198,7 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
GtkSelectionData *selection_data)
{
GnomeIconContainerDetails *details;
GnomeCanvas* canvas = GNOME_CANVAS(container);
GList *p;
GString *data;
......@@ -206,6 +207,7 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
data = g_string_new (NULL);
for (p = details->icons; p != NULL; p = p->next) {
GnomeIconContainerIcon *icon;
gint center_offset;
char *uri;
char *s;
GdkPixbuf *pixbuf;
......@@ -215,8 +217,11 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
if (!icon->is_selected)
continue;
center_offset = nautilus_icons_view_icon_item_center_offset(icon->item);
/* Corner of the icon relative to the cursor. */
icon_x = icon->x - details->dnd_info->start_x;
icon_x = icon->x - details->dnd_info->start_x + floor(center_offset / canvas->pixels_per_unit);
icon_y = icon->y - details->dnd_info->start_y;
uri = nautilus_icons_controller_get_icon_uri (details->controller, icon->data);
......
......@@ -198,6 +198,7 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
GtkSelectionData *selection_data)
{
GnomeIconContainerDetails *details;
GnomeCanvas* canvas = GNOME_CANVAS(container);
GList *p;
GString *data;
......@@ -206,6 +207,7 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
data = g_string_new (NULL);
for (p = details->icons; p != NULL; p = p->next) {
GnomeIconContainerIcon *icon;
gint center_offset;
char *uri;
char *s;
GdkPixbuf *pixbuf;
......@@ -215,8 +217,11 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
if (!icon->is_selected)
continue;
center_offset = nautilus_icons_view_icon_item_center_offset(icon->item);
/* Corner of the icon relative to the cursor. */
icon_x = icon->x - details->dnd_info->start_x;
icon_x = icon->x - details->dnd_info->start_x + floor(center_offset / canvas->pixels_per_unit);
icon_y = icon->y - details->dnd_info->start_y;
uri = nautilus_icons_controller_get_icon_uri (details->controller, icon->data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment