X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/893758d507abf66a429666b9f0b2c1baa195b398..5268c5a32bbe68b834abeaa89c8cfb2099d50d2e:/src/os2/dc.cpp diff --git a/src/os2/dc.cpp b/src/os2/dc.cpp index c0f1fefcd4..8c8d8a66a4 100644 --- a/src/os2/dc.cpp +++ b/src/os2/dc.cpp @@ -23,6 +23,7 @@ #include "wx/log.h" #include "wx/icon.h" #include "wx/msgdlg.h" + #include "wx/module.h" #endif #include "wx/dcprint.h" @@ -204,7 +205,7 @@ wxDCCacheEntry* wxDC::FindBitmapInCache( , int nHeight ) { - int nDepth = 24 // we'll fix this later ::GetDeviceCaps((HDC) dc, PLANES) * ::GetDeviceCaps((HDC) dc, BITSPIXEL); + int nDepth = 24; // we'll fix this later ::GetDeviceCaps((HDC) dc, PLANES) * ::GetDeviceCaps((HDC) dc, BITSPIXEL); wxNode* pNode = m_svBitmapCache.First(); BITMAPINFOHEADER2 vBmpHdr; @@ -541,6 +542,18 @@ int wxDC::GetDepth() const void wxDC::Clear() { + // + // If this is a canvas DC then just fill with the background color + // Otherwise purge the whole thing + // + if (m_pCanvas) + { + RECTL vRect; + + ::GpiQueryClipBox(m_hPS, &vRect); + ::WinFillRect(m_hPS, &vRect, ::GpiQueryBackColor(m_hPS)); + } + else ::GpiErase(m_hPS); } // end of wxDC::Clear @@ -1795,8 +1808,8 @@ void wxDC::SetMapMode( ulOptions = PU_ARBITRARY | GPIF_DEFAULT; ::GpiSetPS(m_hPS, &vSize, ulOptions); } - m_nWindowExtX = (int)MS_XDEV2LOGREL(VIEWPORT_EXTENT); - m_nWindowExtY = (int)MS_YDEV2LOGREL(VIEWPORT_EXTENT); + m_nWindowExtX = (int)MS_XDEV2LOG(VIEWPORT_EXTENT); + m_nWindowExtY = (int)MS_YDEV2LOG(VIEWPORT_EXTENT); // ???? }; // end of wxDC::SetMapMode @@ -1884,7 +1897,8 @@ wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const { - return (wxCoord) ((x)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX)); + // axis orientation is not taken into account for conversion of a distance + return (wxCoord) ((x)/(m_logicalScaleX*m_userScaleX*m_scaleX)); } wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const @@ -1894,7 +1908,8 @@ wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const { - return (wxCoord) ((y)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY)); + // axis orientation is not taken into account for conversion of a distance + return (wxCoord) ((y)/(m_logicalScaleY*m_userScaleY*m_scaleY)); } wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const @@ -1904,7 +1919,8 @@ wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const { - return (wxCoord) (x*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX); + // axis orientation is not taken into account for conversion of a distance + return (wxCoord) (x*m_logicalScaleX*m_userScaleX*m_scaleX); } wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const @@ -1914,7 +1930,8 @@ wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const { - return (wxCoord) (y*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY); + // axis orientation is not taken into account for conversion of a distance + return (wxCoord) (y*m_logicalScaleY*m_userScaleY*m_scaleY); } // ---------------------------------------------------------------------------