# HG changeset patch # User zas_ # Date 1238439669 0 # Node ID c350242b1a5dc8d94c70d86a1555fc20d1a7c845 # Parent f057c235426f5258764906e59c7c314dc8f7dbbd 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. diff -r f057c235426f -r c350242b1a5d src/layout_image.c --- 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; diff -r f057c235426f -r c350242b1a5d src/pixbuf-renderer.c --- 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);