From 2a6b4b79b069cf7f631e619781ba5e1baf50099c Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 14 Mar 2006 22:14:02 +0000 Subject: [project @ 2006-03-14 22:14:02 by dsilvers] Fix anchoring and repeats for gtk repeated bitmaps svn path=/import/netsurf/; revision=2131 --- gtk/gtk_plotters.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'gtk') diff --git a/gtk/gtk_plotters.c b/gtk/gtk_plotters.c index c6d157a51..dd0add940 100644 --- a/gtk/gtk_plotters.c +++ b/gtk/gtk_plotters.c @@ -188,17 +188,27 @@ bool nsgtk_plot_bitmap_tile(int x, int y, int width, int height, return nsgtk_plot_bitmap(x,y,width,height,bitmap,bg); } - doneheight = cliprect.y - (cliprect.y % height); + if (y > cliprect.y) + doneheight = (cliprect.y - height) + ((y - cliprect.y) % height); + else + doneheight = y; while (doneheight < (cliprect.y + cliprect.height)) { - donewidth = cliprect.x - (cliprect.x % width); + if (x > cliprect.x) + donewidth = (cliprect.x - width) + ((x - cliprect.x) % width); + else + donewidth = x; while (donewidth < (cliprect.x + cliprect.width)) { nsgtk_plot_bitmap(donewidth, doneheight, width, height, bitmap, bg); donewidth += width; + if (!repeat_x) break; } doneheight += height; - } + if (!repeat_y) break; + } + + return true; } -- cgit v1.2.3