Ignore:
Timestamp:
Feb 7, 2012, 9:10:49 AM (14 years ago)
Author:
dmik
Message:

Fix shifted icon AND masks (r21951 regression).

Turns out that ony GetDIBits needs 4-byte alignment while
GetBitmapBits (used to get the AND mask) needs 2-byte alignment.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/winicon.cpp

    r21951 r21964  
    163163    colortablesize = 0;
    164164
    165     // CreateDIBits expectes DWORD-aligned scan lines
     165    // GetDIBits expectes DWORD-aligned scan lines
    166166    bmpXor.bmWidthBytes = (bmpXor.bmWidthBytes + 3) / 4 * 4;
    167     bmpAnd.bmWidthBytes = (bmpAnd.bmWidthBytes + 3) / 4 * 4;
    168167
    169168    if(bmpXor.bmBitsPixel <= 8) {
     
    225224            //recalculate the mask bitmap size
    226225            GetObjectA( hbmMask, sizeof(bmpAnd), &bmpAnd );
    227             sizeAnd = bmpAnd.bmHeight * (bmpAnd.bmWidthBytes + 3) / 4 * 4;
     226            sizeAnd = bmpAnd.bmHeight * bmpAnd.bmWidthBytes;
    228227
    229228            //query the 1bpp bitmap data
     
    11641163    }
    11651164
    1166     // CreateDIBits expectes DWORD-aligned scan lines
     1165    // GetDIBits expectes DWORD-aligned scan lines
    11671166    bmpXor.bmWidthBytes = (bmpXor.bmWidthBytes + 3) / 4 * 4;
    1168     bmpAnd.bmWidthBytes = (bmpAnd.bmWidthBytes + 3) / 4 * 4;
    11691167
    11701168    if(bmpXor.bmBitsPixel <= 8) {
Note: See TracChangeset for help on using the changeset viewer.