diff options
author | Vincent Sanders <vince@netsurf-browser.org> | 2009-03-22 14:34:56 +0000 |
---|---|---|
committer | Vincent Sanders <vince@netsurf-browser.org> | 2009-03-22 14:34:56 +0000 |
commit | 8db32fc061dd4081dce43700db86eb7f6a7856b5 (patch) | |
tree | 0234ded268f14767c9f91f359a7b2f64f57595bb /framebuffer/fb_plotters.c | |
parent | c9fc91c6e4ced28336b3681a64a2a9fefaef2a4a (diff) | |
download | netsurf-8db32fc061dd4081dce43700db86eb7f6a7856b5.tar.gz netsurf-8db32fc061dd4081dce43700db86eb7f6a7856b5.tar.bz2 |
add vertical scrollbar to freamebuffer
svn path=/trunk/netsurf/; revision=6817
Diffstat (limited to 'framebuffer/fb_plotters.c')
-rw-r--r-- | framebuffer/fb_plotters.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/framebuffer/fb_plotters.c b/framebuffer/fb_plotters.c index dc3172a21..46ef82a95 100644 --- a/framebuffer/fb_plotters.c +++ b/framebuffer/fb_plotters.c @@ -61,7 +61,8 @@ enum { /* clip a rectangle to another rectangle */ bool fb_plotters_clip_rect(const bbox_t * restrict clip, - int * restrict x0, int * restrict y0, int * restrict x1, int * restrict y1) + int * restrict x0, int * restrict y0, + int * restrict x1, int * restrict y1) { char region1; char region2; @@ -459,11 +460,20 @@ bool fb_plotters_move_block(int srcx, int srcy, int width, int height, int dstx, /* take shortcut and use memmove */ memmove(dstptr, srcptr, (width * height * framebuffer->bpp) / 8); } else { - - for (hloop = height; hloop > 0; hloop--) { - memmove(dstptr, srcptr, (width * framebuffer->bpp) / 8); - srcptr += framebuffer->linelen; - dstptr += framebuffer->linelen; + if (srcy > dsty) { + for (hloop = height; hloop > 0; hloop--) { + memmove(dstptr, srcptr, (width * framebuffer->bpp) / 8); + srcptr += framebuffer->linelen; + dstptr += framebuffer->linelen; + } + } else { + srcptr += height * framebuffer->linelen; + dstptr += height * framebuffer->linelen; + for (hloop = height; hloop > 0; hloop--) { + srcptr -= framebuffer->linelen; + dstptr -= framebuffer->linelen; + memmove(dstptr, srcptr, (width * framebuffer->bpp) / 8); + } } } /* callback to the os specific routine in case it needs to do something |