summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-03-01 19:31:28 +0000
committerOle Loots <ole@monochrom.net>2011-03-01 19:31:28 +0000
commit443d02b943841f6506828034731e70c71dabdaa1 (patch)
treed9859b4270cf972a3399f1b0515a05cb25e7ba8a
parent58ad73bfc8223acef4ad5f0de1c2884d45692a04 (diff)
downloadnetsurf-443d02b943841f6506828034731e70c71dabdaa1.tar.gz
netsurf-443d02b943841f6506828034731e70c71dabdaa1.tar.bz2
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
-rwxr-xr-xatari/plot.c15
1 files changed, 11 insertions, 4 deletions
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 );