Ignore:
Timestamp:
Feb 6, 2003, 8:20:03 PM (23 years ago)
Author:
sandervl
Message:

Must manually correct y coordinates for DIB section blit since we reset the y inversion back to 0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibsect.cpp

    r8343 r9762  
    1 /* $Id: dibsect.cpp,v 1.63 2002-04-30 13:11:44 sandervl Exp $ */
     1/* $Id: dibsect.cpp,v 1.64 2003-02-06 19:20:03 sandervl Exp $ */
    22
    33/*
     
    392392  {
    393393    pOS2bmp->argbColor[i].fcOptions = 0;
    394 #ifdef DEBUG_PALETTE
     394#ifdef DEBUG
    395395    dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&pOS2bmp->argbColor[i])) ));
    396396#endif
     
    419419    pOS2bmp->argbColor[i].bGreen = palentry[i].peGreen;
    420420    pOS2bmp->argbColor[i].bRed   = palentry[i].peRed;
     421#ifdef DEBUG
     422    dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&pOS2bmp->argbColor[i])) ));
     423#endif
    421424  }
    422425
     
    522525#endif
    523526
     527#ifdef INVERT
     528  oldyinversion = GpiQueryYInversion(hps);
     529  if(oldyinversion != 0) {
     530        POINT viewpt, winpt;
     531
     532        GetViewportOrgEx(hps, &viewpt);
     533        GetWindowOrgEx(hps, &winpt);
     534
     535        dprintf(("Viewport origin (%d,%d)", viewpt.x, viewpt.y));
     536        dprintf(("Windows  origin (%d,%d)", winpt.x, winpt.y));
     537       
     538        /* By resetting y inversion to 0, we must take the new windows
     539         * origin into account. The default matrix set up for the origin
     540         * depends on y inversion. Therefor we must add the y origin value,
     541         * multiplied by two, to the top & bottom coordinates
     542         */
     543        point[0].y -= winpt.y*2;
     544        point[1].y -= winpt.y*2;
     545
     546        /* By resetting y inversion to 0, we must take the new viewport
     547         * origin into account. The default matrix set up for the origin
     548         * depends on y inversion. Therefor we must subtract the y origin value,
     549         * multiplied by two, from the top & bottom coordinates
     550         */
     551        point[0].y -= viewpt.y*2;
     552        point[1].y -= viewpt.y*2;
     553
     554        GpiEnableYInversion(hps, 0);
     555        fRestoryYInversion = TRUE;
     556  }
     557#endif
     558
    524559  dprintf(("DIBSection::BitBlt (%d,%d)(%d,%d) from (%d,%d)(%d,%d) dim (%d,%d)(%d,%d)", point[0].x, point[0].y,
    525560           point[1].x, point[1].y, point[2].x, point[2].y, point[3].x, point[3].y,
    526561           nDestWidth, nDestHeight, nSrcWidth, nSrcHeight));
    527 
    528 #ifdef INVERT
    529   oldyinversion = GpiQueryYInversion(hps);
    530   if(oldyinversion != 0) {
    531 #ifdef DEBUG
    532         POINT point;
    533         GetViewportOrgEx(hps, &point);
    534         dprintf(("Viewport origin (%d,%d)", point.x, point.y));
    535 #endif
    536         GpiEnableYInversion(hps, 0);
    537         fRestoryYInversion = TRUE;
    538   }
    539 #endif
    540562
    541563#ifdef DEBUG
Note: See TracChangeset for help on using the changeset viewer.