changeset 1492:c350242b1a5d

Fixed bug where pixel/color information at x=0 coordinates werent shown: - pixel-coordinates now calculated with floor - guard for update in layout does not apply for 0 coordinates anymore Patch by Ruben Stein.
author zas_
date Mon, 30 Mar 2009 19:01:09 +0000
parents f057c235426f
children a52c4435e461
files src/layout_image.c src/pixbuf-renderer.c
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/layout_image.c	Mon Mar 30 17:52:14 2009 +0000
+++ b/src/layout_image.c	Mon Mar 30 19:01:09 2009 +0000
@@ -1541,7 +1541,7 @@
 	
 	pixbuf_renderer_get_mouse_position(pr, &x_pixel, &y_pixel);
 	
-	if(x_pixel > 0 && y_pixel > 0)
+	if(x_pixel >= 0 && y_pixel >= 0)
 		{
 		gint r_mouse, g_mouse, b_mouse;
 		gint width, height;
--- a/src/pixbuf-renderer.c	Mon Mar 30 17:52:14 2009 +0000
+++ b/src/pixbuf-renderer.c	Mon Mar 30 19:01:09 2009 +0000
@@ -4197,8 +4197,8 @@
 		return FALSE;
 		}
 	
-	x_pixel = (gint)((gdouble)(pr->x_mouse - pr->x_offset + pr->x_scroll) / pr->scale);
-	y_pixel = (gint)((gdouble)(pr->y_mouse - pr->y_offset + pr->y_scroll) / pr->scale);
+	x_pixel = floor((gdouble)(pr->x_mouse - pr->x_offset + pr->x_scroll) / pr->scale);
+	y_pixel = floor((gdouble)(pr->y_mouse - pr->y_offset + pr->y_scroll) / pr->scale);
 	x_pixel_clamped = CLAMP(x_pixel, 0, pr->image_width - 1);
 	y_pixel_clamped = CLAMP(y_pixel, 0, pr->image_height - 1);