[Goodies-commits] r3679 - ristretto/trunk/src

Stephan Arts stephan at xfce.org
Sun Dec 9 01:05:09 CET 2007


Author: stephan
Date: 2007-12-09 00:05:09 +0000 (Sun, 09 Dec 2007)
New Revision: 3679

Modified:
   ristretto/trunk/src/picture_viewer.c
Log:
Center box-zoom


Modified: ristretto/trunk/src/picture_viewer.c
===================================================================
--- ristretto/trunk/src/picture_viewer.c	2007-12-08 23:20:08 UTC (rev 3678)
+++ ristretto/trunk/src/picture_viewer.c	2007-12-09 00:05:09 UTC (rev 3679)
@@ -935,6 +935,7 @@
 
                     gdouble box_width, box_height;
                     gdouble top_left_x, top_left_y;
+
                     if (viewer->priv->motion.x < viewer->priv->motion.current_x)
                     {
                         gint x_offset = (widget->allocation.width - d_width)<=0?0:((widget->allocation.width - d_width)/2);
@@ -966,10 +967,16 @@
                     if (h_scale < v_scale)
                     {
                         rstto_navigator_entry_set_scale(entry, h_scale);
+                        gdouble d_box_height = box_height * v_scale / h_scale;
+                        top_left_y -= (d_box_height - box_height) / 2;
+                        box_height = d_box_height;
                     }
                     else
                     {
                         rstto_navigator_entry_set_scale(entry, v_scale);
+                        gdouble d_box_width = box_width * h_scale / v_scale;
+                        top_left_x -= (d_box_width - box_width) / 2;
+                        box_width = d_box_width;
                     }
 
                     rstto_navigator_entry_set_fit_to_screen(entry, FALSE);




More information about the Goodies-commits mailing list