[PATCH] Icon dragging is broken with zoom levels != 100%



I've attached a patch to bug #142491:

The initial drag position is a world coordinate which doesn't take the
zoom level into accout, so it needs to be converted into a canvas
coordinate before beginning the drag. Currently this conversion doesn't
take place, so it only works for 100% zoom. If you change it to
something else, the effect described in this bug occurs.

Martin


Index: nautilus-icon-container.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-icon-container.c,v
retrieving revision 1.373
diff -u -p -w -r1.373 nautilus-icon-container.c
--- nautilus-icon-container.c	7 May 2004 12:27:17 -0000	1.373
+++ nautilus-icon-container.c	20 May 2004 21:24:55 -0000
@@ -3535,6 +3535,7 @@ motion_notify_event (GtkWidget *widget,
 	NautilusIconContainer *container;
 	NautilusIconContainerDetails *details;
 	double world_x, world_y;
+	int canvas_x, canvas_y;
 
 	container = NAUTILUS_ICON_CONTAINER (widget);
 	details = container->details;
@@ -3561,6 +3562,12 @@ motion_notify_event (GtkWidget *widget,
 
 				end_renaming_mode (container, TRUE);
 			
+				eel_canvas_w2c (EEL_CANVAS (container),
+						  details->drag_x,
+						  details->drag_y,
+						  &canvas_x,
+						  &canvas_y);
+
 				nautilus_icon_dnd_begin_drag (container,
 							      details->drag_state == DRAG_STATE_MOVE_OR_COPY
 							      ? (GDK_ACTION_MOVE 
@@ -3570,8 +3577,8 @@ motion_notify_event (GtkWidget *widget,
 							      : GDK_ACTION_ASK,
 							      details->drag_button,
 							      event, 
-							      details->drag_x,
-							      details->drag_y);
+							      canvas_x,
+							      canvas_y);
 			}
 			break;
 		case DRAG_STATE_STRETCH:


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