Ignore:
Timestamp:
Oct 18, 2001, 11:06:02 PM (24 years ago)
Author:
umoeller
Message:

misc changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/gpih.c

    r94 r111  
    305305    ptl1.y = prcl->yBottom;
    306306    GpiMove(hps, &ptl1);
    307     ptl1.y = prcl->yTop-1;
     307    ptl1.y = prcl->yTop - 1;
    308308    GpiLine(hps, &ptl1);
    309     ptl1.x = prcl->xRight-1;
     309    ptl1.x = prcl->xRight - 1;
    310310    GpiLine(hps, &ptl1);
    311311    ptl1.y = prcl->yBottom;
     
    19731973 *@@ gpihIcon2Bitmap:
    19741974 *      this paints the given icon/pointer into
    1975  *      a bitmap.
     1975 *      a bitmap. Note that if the bitmap is
     1976 *      larget than the system icon size, only
     1977 *      the rectangle of the icon will be filled
     1978 *      with lBkgndColor.
    19761979 *
    19771980 *      Returns FALSE upon errors.
    19781981 *
    19791982 *@@added V0.9.0 [umoeller]
     1983 *@@changed V0.9.16 (2001-10-15) [umoeller]: added pptlLowerLeft
     1984 *@@changed V0.9.16 (2001-10-15) [umoeller]: fixed inclusive/exclusive confusion (sigh...)
    19801985 */
    19811986
     
    19831988                     HPOINTER hptr,      // in: source icon
    19841989                     LONG lBkgndColor,   // in: background color for transparent areas
     1990                     PPOINTL pptlLowerLeft,   // in: lower left corner of where to paint (ptr can be NULL)
    19851991                     ULONG ulIconSize)   // in: icon size (should be the value of WinQuerySysValue(HWND_DESKTOP, SV_CXICON))
    19861992{
     
    20032009    if (WinQueryPointerInfo(hptr, &pi))
    20042010    {
     2011        POINTL  ptlLowerLeft = {0, 0};
    20052012        POINTL  aptl[4];
    20062013        memset(aptl, 0, sizeof(POINTL) * 4);
    20072014
     2015        if (pptlLowerLeft)
     2016            // lower left specified: V0.9.16 (2001-10-15) [umoeller]
     2017            memcpy(&ptlLowerLeft, pptlLowerLeft, sizeof(POINTL));
     2018
    20082019        // aptl[0]: target bottom-left, is all 0
     2020        aptl[0].x = ptlLowerLeft.x;
     2021        aptl[0].y = ptlLowerLeft.y;
    20092022
    20102023        // aptl[1]: target top-right (inclusive!)
    2011         aptl[1].x = ulIconSize;
    2012         aptl[1].y = ulIconSize;
     2024        // V0.9.16 (2001-10-15) [umoeller]: fixed rectangle confusion
     2025        aptl[1].x = ptlLowerLeft.x + ulIconSize - 1;
     2026        aptl[1].y = ptlLowerLeft.y + ulIconSize - 1;
    20132027
    20142028        // aptl[2]: source bottom-left, is all 0
    20152029
    20162030        // aptl[3]: source top-right (exclusive!)
    2017         aptl[3].x = ulIconSize + 1;
    2018         aptl[3].y = ulIconSize + 1;
     2031        // V0.9.16 (2001-10-15) [umoeller]: fixed rectangle confusion
     2032        aptl[3].x = ulIconSize; //  + 1;
     2033        aptl[3].y = ulIconSize; //  + 1;
    20192034
    20202035        GpiSetColor(hpsMem, CLR_WHITE);
     
    20242039
    20252040        // work on the AND image
    2026         GpiWCBitBlt(hpsMem,
    2027                     pi.hbmPointer,
     2041        GpiWCBitBlt(hpsMem,     // target
     2042                    pi.hbmPointer,  // src bmp
    20282043                    4L,         // must always be 4
    20292044                    &aptl[0],   // point array
     
    20422057        GpiSetColor(hpsMem, lBkgndColor);
    20432058        // work on the XOR image
    2044         aptl[2].y = ulIconSize;
    2045         aptl[3].y = (ulIconSize * 2) + 1;
     2059        aptl[2].y = ulIconSize;                 // exclusive
     2060        aptl[3].y = (ulIconSize * 2); //  /* + 1; */       // exclusive
     2061        // V0.9.16 (2001-10-15) [umoeller]: fixed rectangle confusion
    20462062        GpiWCBitBlt(hpsMem,
    20472063                    pi.hbmPointer,
Note: See TracChangeset for help on using the changeset viewer.