X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1c9a789ed98cc1db72451cb2f812954ec173b6d9..7d09b97f5321d0accd758eb420c008853ad9ec26:/src/os2/dcmemory.cpp diff --git a/src/os2/dcmemory.cpp b/src/os2/dcmemory.cpp index 8dc8321f77..26e11bfe8d 100644 --- a/src/os2/dcmemory.cpp +++ b/src/os2/dcmemory.cpp @@ -58,14 +58,12 @@ void wxMemoryDC::Init() memset(&m_vRclPaint, 0, sizeof(m_vRclPaint)); } // end of wxMemoryDC::Init -bool wxMemoryDC::CreateCompatible( - wxDC* pDC -) +bool wxMemoryDC::CreateCompatible( wxDC* WXUNUSED(pDC) ) { - HDC hDC; - HPS hPS; - DEVOPENSTRUC vDOP = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L}; - SIZEL vSize = {0, 0}; + HDC hDC; + HPS hPS; + DEVOPENSTRUC vDOP = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L}; + SIZEL vSize = {0, 0}; // // Create a memory device context @@ -78,10 +76,10 @@ bool wxMemoryDC::CreateCompatible( { m_hPS = hPS; m_hDC = hDC; - m_ok = TRUE; - m_bOwnsDC = TRUE; + m_ok = true; + m_bOwnsDC = true; // - // Set the wxWindows color table + // Set the wxWidgets color table // ::GpiCreateLogColorTable( m_hPS ,0L @@ -117,7 +115,7 @@ bool wxMemoryDC::CreateCompatible( // // As we created the DC, we must delete it in the dtor // - m_bOwnsDC = TRUE; + m_bOwnsDC = true; m_ok = m_hDC != 0; return m_ok; } // end of wxMemoryDC::CreateCompatible @@ -150,6 +148,23 @@ void wxMemoryDC::SelectObject( if (!hBmp) { + // + // Bmps drawn to are upside down, so flip it before committing + // + POINTL vPoint[4] = { {0, m_vSelectedBitmap.GetHeight()} + ,{m_vSelectedBitmap.GetWidth(), 0} + ,{0, 0} + ,{m_vSelectedBitmap.GetWidth(), m_vSelectedBitmap.GetHeight()} + }; + + + ::GpiBitBlt( m_hPS + ,m_hPS + ,4 + ,vPoint + ,ROP_SRCCOPY + ,BBO_IGNORE + ); m_vSelectedBitmap.SetSelectedInto(NULL); } m_vSelectedBitmap = rBitmap; @@ -157,6 +172,7 @@ void wxMemoryDC::SelectObject( if (!hBmp) { + m_hOldBitmap = (WXHBITMAP)::GpiSetBitmap(m_hPS, NULLHANDLE); return; } @@ -184,4 +200,3 @@ void wxMemoryDC::DoGetSize( *pWidth = m_vSelectedBitmap.GetWidth(); *pHeight = m_vSelectedBitmap.GetHeight(); } // end of wxMemoryDC::DoGetSize -