changeset 760:649b44dd558b

Fix histogram grid - patch by Uwe Ohse
author nadvornik
date Mon, 26 May 2008 18:32:04 +0000
parents 362c9a769bb7
children a2dda8e61e0f
files src/image-overlay.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/image-overlay.c	Mon May 26 18:22:08 2008 +0000
+++ b/src/image-overlay.c	Mon May 26 18:32:04 2008 +0000
@@ -611,19 +611,19 @@
 			gint x = 5;
 			gint y = height - HISTOGRAM_HEIGHT - 5;
 			gint w = width - 10;
-			gint xoffset = 0;
+			float xoffset = 0;
 			gint subdiv = 5;
 			gint c = 160;
 			gint alpha = 250;
 			gint i;
+			float add = w / (float)subdiv;
 
 			for (i = 0; i < subdiv; i++)
 				{
 				gint d = (i > 0 ? 0 : 1);
-				gint div_width = d + w / subdiv;
 
-				pixbuf_set_rect(pixbuf, x + xoffset, y, div_width, HISTOGRAM_HEIGHT, c, c, c, alpha, d, 1, 1, 1);
-				xoffset += div_width;
+				pixbuf_set_rect(pixbuf, x + xoffset + 0.5, y, add + d + 0.5, HISTOGRAM_HEIGHT, c, c, c, alpha, d, 1, 1, 1);
+				xoffset += add+d;
 				}
 						
 			histogram_draw(osd->histogram, pixbuf, x, y, w, HISTOGRAM_HEIGHT);