diff src/image.c @ 13:ef790149ae21

##### Note: GQview CVS on sourceforge is not always up to date, please use ##### ##### an offical release when making enhancements and translation updates. ##### Tue Mar 1 21:39:42 2005 John Ellis <johne@verizon.net> * image.[ch] (image_scroll_to_point): Add alignment for location of point within visible region. * pan-view.c: Use alignment for scrolling above, and fix date search to only search thumbs and images.
author gqview
date Wed, 02 Mar 2005 02:47:53 +0000
parents 147f4c4b9025
children 25335c62cd9b
line wrap: on
line diff
--- a/src/image.c	Tue Mar 01 17:16:34 2005 +0000
+++ b/src/image.c	Wed Mar 02 02:47:53 2005 +0000
@@ -3427,12 +3427,20 @@
 	image_scroll_real(imd, x, y);
 }
 
-void image_scroll_to_point(ImageWindow *imd, gint x, gint y)
+void image_scroll_to_point(ImageWindow *imd, gint x, gint y,
+			   gdouble x_align, gdouble y_align)
 {
 	gint px, py;
-
-	px = (gdouble)x * imd->scale - imd->x_scroll;
-	py = (gdouble)y * imd->scale - imd->y_scroll;
+	gint ax, ay;
+
+	x_align = CLAMP(x_align, 0.0, 1.0);
+	y_align = CLAMP(y_align, 0.0, 1.0);
+
+	ax = (gdouble)imd->vis_width * x_align;
+	ay = (gdouble)imd->vis_height * y_align;
+
+	px = (gdouble)x * imd->scale - (imd->x_scroll + ax);
+	py = (gdouble)y * imd->scale - (imd->y_scroll + ay);
 
 	image_scroll(imd, px, py);
 }