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

Stephan Arts stephan at xfce.org
Sat Nov 3 14:54:19 CET 2007


Author: stephan
Date: 2007-11-03 13:54:18 +0000 (Sat, 03 Nov 2007)
New Revision: 3501

Modified:
   ristretto/trunk/src/thumbnail_viewer.c
Log:
Fix rendering bug with thumbnail-viewer



Modified: ristretto/trunk/src/thumbnail_viewer.c
===================================================================
--- ristretto/trunk/src/thumbnail_viewer.c	2007-11-03 10:45:47 UTC (rev 3500)
+++ ristretto/trunk/src/thumbnail_viewer.c	2007-11-03 13:54:18 UTC (rev 3501)
@@ -235,7 +235,7 @@
         gint min = nr - (((widget->allocation.width - viewer->priv->dimension) / 2) / viewer->priv->dimension) - 1;
         gint max = nr + (((widget->allocation.width - viewer->priv->dimension) / 2) / viewer->priv->dimension) + 1;
         viewer->priv->begin = min < 0? 0 : min;
-        viewer->priv->end = max > n_entries? n_entries: max;
+        viewer->priv->end = max >= n_entries? n_entries - 1: max;
     }
     else
     {
@@ -243,7 +243,7 @@
         gint min = nr - (((widget->allocation.height - viewer->priv->dimension) / 2) / viewer->priv->dimension) - 1;
         gint max = nr + (((widget->allocation.height - viewer->priv->dimension) / 2) / viewer->priv->dimension) + 1;
         viewer->priv->begin = min < 0? 0 : min;
-        viewer->priv->end = max > n_entries? n_entries: max;
+        viewer->priv->end = max >= n_entries? n_entries - 1: max;
     }
 
     viewer->priv->offset = offset;
@@ -262,12 +262,12 @@
                                 offset,
                                 widget->allocation.height);
         }
-        if ((offset + ((viewer->priv->end + 1) * viewer->priv->dimension)) < widget->allocation.width)
+        if (offset + ((viewer->priv->end + 1) * viewer->priv->dimension) < widget->allocation.width)
         {
             gdk_window_clear_area(widget->window, 
-                                offset + ((viewer->priv->end ) * viewer->priv->dimension),
+                                offset + ((viewer->priv->end + 1) * viewer->priv->dimension),
                                 0,
-                                widget->allocation.width - (offset + (viewer->priv->end * viewer->priv->dimension)),
+                                widget->allocation.width - (offset + ((viewer->priv->end  + 1)* viewer->priv->dimension)),
                                 widget->allocation.height);
 
         }
@@ -282,13 +282,13 @@
                                 widget->allocation.width,
                                 offset);
         }
-        if ((offset + ((viewer->priv->end + 1) * viewer->priv->dimension)) < widget->allocation.height)
+        if (offset + ((viewer->priv->end + 1) * viewer->priv->dimension) < widget->allocation.height)
         {
             gdk_window_clear_area(widget->window, 
                                 0,
-                                offset + ((viewer->priv->end) * viewer->priv->dimension),
+                                offset + ((viewer->priv->end + 1) * viewer->priv->dimension),
                                 widget->allocation.width,
-                                widget->allocation.height - (offset + (viewer->priv->end * viewer->priv->dimension)));
+                                widget->allocation.height - (offset + ((viewer->priv->end + 1) * viewer->priv->dimension)));
         }
     }
 }




More information about the Goodies-commits mailing list