Fix framebuffer tiled plot to use x and y coords correctly. Fixes top of bbc news graduated fill extent.

svn path=/trunk/netsurf/; revision=6589
This commit is contained in:
Michael Drake 2009-02-21 15:06:15 +00:00
parent d4e5a3ae31
commit dfa4b437e7

View File

@ -430,9 +430,10 @@ bool fb_plotters_bitmap_tile(int x, int y,
{
int xf,yf;
/* x and y define top left hand corner of tile start, the width height
* are the mage scaling and the bounding box defines teh extent of the
* repeat
/* x and y define coordinate of top left of of the initial explicitly
* placed tile. The width and height are the image scaling and the
* bounding box defines the extent of the repeat (which may go in all
* four directions from the initial tile).
*/
LOG(("x %d, y %d, width %d, height %d, bitmap %p, repx %d repy %d content %p", x,y,width,height,bitmap,repeat_x, repeat_y, content));
@ -443,16 +444,40 @@ bool fb_plotters_bitmap_tile(int x, int y,
return bitmapfn(x, y, width, height, bitmap, bg,content);
}
/* Initial tile and repeat left, right and down */
for (xf = x; xf < fb_plot_ctx.x1; xf += width) {
for (yf = y; yf < fb_plot_ctx.y1; yf += height) {
bitmapfn(xf, yf, width, height, bitmap, bg, content);
if (!repeat_y)
break;
}
for (yf = y - height; yf + height > fb_plot_ctx.y0;
yf -= height) {
if (!repeat_y)
break;
bitmapfn(xf, yf, width, height, bitmap, bg, content);
}
if (!repeat_x)
break;
}
/* repeat left and right above */
for (xf = x - width; xf + height > fb_plot_ctx.x0; xf -= width) {
if (!repeat_x)
break;
for (yf = y; yf < fb_plot_ctx.y1; yf += height) {
bitmapfn(xf, yf, width, height, bitmap, bg, content);
if (!repeat_y)
break;
}
for (yf = y - height; yf + height > fb_plot_ctx.y0;
yf -= height) {
if (!repeat_y)
break;
bitmapfn(xf, yf, width, height, bitmap, bg, content);
}
}
return true;
}