Changeset 07bd231e in mainline


Ignore:
Timestamp:
2007-05-04T14:03:26Z (18 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4f42d52
Parents:
ea63704
Message:

copy proper portion of viewport on screen border
(fixes ticket #34)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/fb/fb.c

    rea63704 r07bd231e  
    834834{
    835835        int y;
    836         int rowsize;
    837         int tmp;
     836        int tmp, srcrowsize;
     837        int realwidth, realheight, realrowsize;
    838838        int width = vport->width;
    839839        int height = vport->height;
     
    841841        if (width + vport->x > screen.xres)
    842842                width = screen.xres - vport->x;
    843         if (height + vport->y  > screen.yres)
     843        if (height + vport->y > screen.yres)
    844844                height = screen.yres - vport->y;
    845 
    846         rowsize = width * screen.pixelbytes;
    847 
    848         for (y = 0; y < height; y++) {
     845       
     846        realwidth = pmap->width <= width ? pmap->width : width;
     847        realheight = pmap->height <= height ? pmap->height : height;
     848
     849        srcrowsize = vport->width * screen.pixelbytes;
     850        realrowsize = realwidth * screen.pixelbytes;
     851       
     852        for (y = 0; y < realheight; y++) {
    849853                tmp = (vport->y + y) * screen.scanline +
    850854                        vport->x * screen.pixelbytes;
    851                 memcpy(pmap->data + rowsize * y, screen.fbaddress + tmp,
    852                         rowsize);
     855                memcpy(pmap->data + srcrowsize * y, screen.fbaddress + tmp,
     856                        realrowsize);
    853857        }
    854858}
Note: See TracChangeset for help on using the changeset viewer.