diff options
author | Rob Kendrick <rjek@netsurf-browser.org> | 2007-02-02 22:24:42 +0000 |
---|---|---|
committer | Rob Kendrick <rjek@netsurf-browser.org> | 2007-02-02 22:24:42 +0000 |
commit | 0b9076903218b8350930725ff59b86baca37dd02 (patch) | |
tree | 84745448794633dc2e34c507d20658730209014d | |
parent | 66a69bc889332cdbac2eac5226c967cd5dc8cc25 (diff) | |
download | netsurf-0b9076903218b8350930725ff59b86baca37dd02.tar.gz netsurf-0b9076903218b8350930725ff59b86baca37dd02.tar.bz2 |
Fix more off-by-ones in nsgtk's image plotting and clipping. AFAICT, this is now perfect.
svn path=/trunk/netsurf/; revision=3164
-rw-r--r-- | gtk/gtk_plotters.c | 12 |
1 files 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, |