comparison 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
comparison
equal deleted inserted replaced
12:147f4c4b9025 13:ef790149ae21
3425 void image_scroll(ImageWindow *imd, gint x, gint y) 3425 void image_scroll(ImageWindow *imd, gint x, gint y)
3426 { 3426 {
3427 image_scroll_real(imd, x, y); 3427 image_scroll_real(imd, x, y);
3428 } 3428 }
3429 3429
3430 void image_scroll_to_point(ImageWindow *imd, gint x, gint y) 3430 void image_scroll_to_point(ImageWindow *imd, gint x, gint y,
3431 gdouble x_align, gdouble y_align)
3431 { 3432 {
3432 gint px, py; 3433 gint px, py;
3433 3434 gint ax, ay;
3434 px = (gdouble)x * imd->scale - imd->x_scroll; 3435
3435 py = (gdouble)y * imd->scale - imd->y_scroll; 3436 x_align = CLAMP(x_align, 0.0, 1.0);
3437 y_align = CLAMP(y_align, 0.0, 1.0);
3438
3439 ax = (gdouble)imd->vis_width * x_align;
3440 ay = (gdouble)imd->vis_height * y_align;
3441
3442 px = (gdouble)x * imd->scale - (imd->x_scroll + ax);
3443 py = (gdouble)y * imd->scale - (imd->y_scroll + ay);
3436 3444
3437 image_scroll(imd, px, py); 3445 image_scroll(imd, px, py);
3438 } 3446 }
3439 3447
3440 void image_alter(ImageWindow *imd, AlterType type) 3448 void image_alter(ImageWindow *imd, AlterType type)