Screenshots page / BBC

Michael Drake tlsa at
Sun Feb 27 13:20:22 GMT 2011

m0n0 <ole at> wrote:

> But why isn't the gradient renderer? Because the image shall be drawn
> completely outside of the clipping rectangle ( clipping is from x: 0, y:
> 0, x1: window_width, y1: 40) - the plot function is called with 250 as y
> coord - that's not within the clipping rectangle... so the image will
> never be drawn.

Ah, right, this is expected behaviour.

Consider the following css:

div.example {
        background: url(bg.png) bottom right;
        width: 1000px;
        height: 1000px;}

A box generated for <div class="example"></div> will have the background
image bg.png tiled over the 1000x1000 area of the box.  The "bottom right"
part says that the image is explicitly placed at the bottom right, so if
the image is 3px by 3px, then the image is positioned at a position 997
from the top of the box, and 997 from the left of the box.  It is tiled
such that one of the tiles is exactly at that coordinate.

If you only need to redraw the top half of the box, because the rest is
outside the viewport, then that coordinate is outside the clipping
rectangle.  You still have to draw the visible area with the tiled
background, and the tiles must still be positioned to coincide with the
explicitly given tile coordinate, whether it's inside the clipping
rectangle or not.

I fixed this in the framebuffer front end. See framebuffer/framebuffer.c,
where it gets the left most tile position, and the top most tile position,
and then tiles to the extents of the clip region.


Michael Drake (tlsa)        

More information about the netsurf-dev mailing list