From 0b9076903218b8350930725ff59b86baca37dd02 Mon Sep 17 00:00:00 2001 From: Rob Kendrick Date: Fri, 2 Feb 2007 22:24:42 +0000 Subject: Fix more off-by-ones in nsgtk's image plotting and clipping. AFAICT, this is now perfect. svn path=/trunk/netsurf/; revision=3164 --- gtk/gtk_plotters.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/gtk/gtk_plotters.c b/gtk/gtk_plotters.c index 97681b451..dee34336c 100644 --- a/gtk/gtk_plotters.c +++ b/gtk/gtk_plotters.c @@ -195,15 +195,15 @@ bool nsgtk_plot_clip(int clip_x0, int clip_y0, #ifdef CAIRO_VERSION if (option_render_cairo) { cairo_reset_clip(current_cr); - cairo_rectangle(current_cr, clip_x0 - 1, clip_y0 - 1, - clip_x1 - clip_x0 + 1, clip_y1 - clip_y0 + 1); + cairo_rectangle(current_cr, clip_x0, clip_y0, + clip_x1 - clip_x0, clip_y1 - clip_y0); cairo_clip(current_cr); } #endif cliprect.x = clip_x0; cliprect.y = clip_y0; - cliprect.width = clip_x1 - clip_x0 + 1; - cliprect.height = clip_y1 - clip_y0 + 1; + cliprect.width = clip_x1 - clip_x0; + cliprect.height = clip_y1 - clip_y0; gdk_gc_set_clip_rectangle(current_gc, &cliprect); return true; } @@ -275,9 +275,7 @@ static bool nsgtk_plot_pixbuf(int x, int y, int width, int height, if (width == 0 || height == 0) return true; - width++; /* TODO: investigate why this is required */ - - if (gdk_pixbuf_get_width(pixbuf) == (width - 1) && + if (gdk_pixbuf_get_width(pixbuf) == width && gdk_pixbuf_get_height(pixbuf) == height) { gdk_draw_pixbuf(current_drawable, current_gc, pixbuf, -- cgit v1.2.3