From 443d02b943841f6506828034731e70c71dabdaa1 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Tue, 1 Mar 2011 19:31:28 +0000 Subject: Fixed missing draw of tiled bitmap which are completly outside of the clipping rectangle , adjusted clipping rect changes for atari frontend svn path=/trunk/netsurf/; revision=11876 --- atari/plot.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'atari') diff --git a/atari/plot.c b/atari/plot.c index 60570fae2..a9a9141b1 100755 --- a/atari/plot.c +++ b/atari/plot.c @@ -161,7 +161,7 @@ static bool plot_bitmap(int x, int y, int width, int height, if ( repeat_x || repeat_y ) { plotter_get_clip( plotter, &clip ); - if( repeat_x && width == 1 && repeat_y && height == 1 ){ + if( repeat_x && width == 1 && repeat_y && height == 1 ){ width = MAX( width, clip.x1 - x ); height = MAX( height, clip.y1 - y ); } @@ -181,8 +181,10 @@ static bool plot_bitmap(int x, int y, int width, int height, } /* out of memory? */ - if( bm == NULL ) + if( bm == NULL ) { + printf("plot: out of memory!"); return( true ); + } if (!(repeat_x || repeat_y)) { plotter->bitmap( plotter, bm, x, y, bg, flags ); @@ -190,14 +192,19 @@ static bool plot_bitmap(int x, int y, int width, int height, int xf,yf; int xoff = x; int yoff = y; + + if (yoff > clip.y0 ) + yoff = (clip.y0 - height) + ((yoff - clip.y0) % height); + if (xoff > clip.x0 ) + xoff = (clip.x0 - width) + ((xoff - clip.x0) % width); /* for now, repeating just works in the rigth / down direction */ /* if( repeat_x == true ) xoff = clip.x0; if(repeat_y == true ) yoff = clip.y0; - */ - + */ + for( xf = xoff; xf < clip.x1; xf += width ) { for( yf = yoff; yf < clip.y1; yf += height ) { plotter->bitmap( plotter, bm, xf, yf, bg, flags ); -- cgit v1.2.3