[Xfce4-commits] <ristretto:master> Improve moving of the image

Stephan Arts stephan at xfce.org
Wed Aug 12 12:19:33 CEST 2009


Updating branch refs/heads/master
         to 148698070231eb6527c8e08cec68e0de5b432eea (commit)
       from 7566a5a251dd6a37bc30889dab19aa8615361b5a (commit)

commit 148698070231eb6527c8e08cec68e0de5b432eea
Author: Stephan Arts <stephan at xfce.org>
Date:   Fri Mar 13 20:06:01 2009 +0100

    Improve moving of the image

 src/picture_viewer.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/picture_viewer.c b/src/picture_viewer.c
index 910c6cb..ec42a81 100644
--- a/src/picture_viewer.c
+++ b/src/picture_viewer.c
@@ -987,15 +987,15 @@ cb_rstto_picture_viewer_queued_repaint (RsttoPictureViewer *viewer)
              *  tmp_scale is the factor between the original image and the thumbnail,
              *  when looking at the actual image, tmp_scale == 1.0
              */
-            gint x = (gint)viewer->hadjustment->value * scale;
-            gint y = (gint)viewer->vadjustment->value * scale;
+            gdouble x = viewer->hadjustment->value;
+            gdouble y = viewer->vadjustment->value;
 
             p_tmp_pixbuf = gdk_pixbuf_new_subpixbuf (p_src_pixbuf,
-                                               (gint)(x * thumb_scale), 
-                                                      (y * thumb_scale),
-                                                    ((widget->allocation.width / scale) < width?
+                                               (gint)(x/scale * thumb_scale), 
+                                               (gint)(y/scale * thumb_scale),
+                                               (gint)((widget->allocation.width / scale) < width?
                                                       (widget->allocation.width / scale)*thumb_scale:width*thumb_scale),
-                                                    ((widget->allocation.height / scale) < height?
+                                               (gint)((widget->allocation.height / scale) < height?
                                                       (widget->allocation.height / scale)*thumb_scale:height*thumb_scale));
 
             if(viewer->priv->dst_pixbuf)



More information about the Xfce4-commits mailing list