diff src/image.c @ 14:25335c62cd9b

##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. ##### Thu Mar 3 01:16:23 2005 John Ellis <johne@verizon.net> * pan-view.c: Add 'dots' image size option, fix up border size at edge of grid, and make drag and drop work to/from the window. Wed Mar 2 23:34:30 2005 John Ellis <johne@verizon.net> * globals.c, gqview.h, rcfile.c: Add thumbnail_fast option variable. * image-load.c, typedefs.h: Add shrunk flag to determine if an image was scaled down using image_loader_set_requested_size. * image.c: Make panning with mouse scroll more when holding shift key. * preferences.c: Add option for 'Fast jpeg thumbnailing' and disabled xvpics option in the gui - now a hidden option. * thumb.c, thumb_standard.c: Add support for thumbnail_fast option..
author gqview
date Thu, 03 Mar 2005 06:32:53 +0000
parents ef790149ae21
children 17acca639a86
line wrap: on
line diff
--- a/src/image.c	Wed Mar 02 02:47:53 2005 +0000
+++ b/src/image.c	Thu Mar 03 06:32:53 2005 +0000
@@ -23,7 +23,10 @@
 #include <math.h>
 
 
+/* size to use when breaking up image pane for rendering */
 #define IMAGE_TILE_SIZE 512
+
+/* default min and max zoom */
 #define IMAGE_ZOOM_MIN -32.0
 #define IMAGE_ZOOM_MAX 32.0
 
@@ -42,6 +45,9 @@
 /* distance to drag mouse to disable image flip */
 #define IMAGE_DRAG_SCROLL_THRESHHOLD 4
 
+/* increase pan rate when holding down shift */
+#define IMAGE_PAN_SHIFT_MULTIPLIER 6
+
 /* alpha channel checkerboard background (same as gimp) */
 #define IMAGE_ALPHA_CHECK1 0x00999999
 #define IMAGE_ALPHA_CHECK2 0x00666666
@@ -3001,6 +3007,7 @@
 static gint image_mouse_motion_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data)
 {
 	ImageWindow *imd = data;
+	gint accel;
 
 	if (imd->scroller_id != -1)
 		{
@@ -3019,8 +3026,18 @@
 		widget_set_cursor (imd->image, GDK_FLEUR);
 		}
 
+	if (bevent->state & GDK_SHIFT_MASK)
+		{
+		accel = IMAGE_PAN_SHIFT_MULTIPLIER;
+		}
+	else
+		{
+		accel = 1;
+		}
+
 	/* do the scroll */
-	image_scroll_real(imd, imd->drag_last_x - bevent->x, imd->drag_last_y - bevent->y);
+	image_scroll_real(imd, (imd->drag_last_x - bevent->x) * accel,
+			       (imd->drag_last_y - bevent->y) * accel);
 
 	imd->drag_last_x = bevent->x;
 	imd->drag_last_y = bevent->y;
@@ -3078,13 +3095,16 @@
 		widget_set_cursor(imd->image, -1);
 		}
 
-	if (bevent->button == 1 && (bevent->state & GDK_SHIFT_MASK))
+	if (imd->drag_moved < IMAGE_DRAG_SCROLL_THRESHHOLD)
 		{
-		image_scroller_start(imd, bevent->x, bevent->y);
-		}
-	else if (bevent->button == 1 || bevent->button == 2)
-		{
-		if (imd->drag_moved < IMAGE_DRAG_SCROLL_THRESHHOLD) image_button_do(imd, bevent);
+		if (bevent->button == 1 && (bevent->state & GDK_SHIFT_MASK))
+			{
+			image_scroller_start(imd, bevent->x, bevent->y);
+			}
+		else if (bevent->button == 1 || bevent->button == 2)
+			{
+			image_button_do(imd, bevent);
+			}
 		}
 
 	imd->in_drag = FALSE;