X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9de1027152fd1bd3e8c0d9b5e9f4b19b0bbc3a10..6f3f9b50aa275243ade3541ecccb95de22cf57a9:/src/os2/dc.cpp diff --git a/src/os2/dc.cpp b/src/os2/dc.cpp index 09fe982e45..3e6e349b6a 100644 --- a/src/os2/dc.cpp +++ b/src/os2/dc.cpp @@ -25,10 +25,9 @@ #include "wx/msgdlg.h" #include "wx/dcprint.h" #include "wx/statusbr.h" + #include "wx/module.h" #endif -#include "wx/module.h" - #include #include "wx/os2/private.h" @@ -657,7 +656,7 @@ void wxDC::DoDrawLine( } else { - if (m_vSelectedBitmap != wxNullBitmap) + if (m_vSelectedBitmap.Ok()) { m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight(); m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth(); @@ -987,7 +986,7 @@ void wxDC::DoDrawRectangle( vY = OS2Y(vY,vHeight); else { - if (m_vSelectedBitmap != wxNullBitmap) + if (m_vSelectedBitmap.Ok()) { m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight(); m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth(); @@ -1077,7 +1076,7 @@ void wxDC::DoDrawRoundedRectangle( vY = OS2Y(vY,vHeight); else { - if (m_vSelectedBitmap != wxNullBitmap) + if (m_vSelectedBitmap.Ok()) { m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight(); m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth(); @@ -1744,7 +1743,7 @@ void wxDC::DrawAnyText( const wxString& rsText, } else { - if (m_vSelectedBitmap != wxNullBitmap) + if (m_vSelectedBitmap.Ok()) { m_vRclPaint.yTop = m_vSelectedBitmap.GetHeight(); m_vRclPaint.xRight = m_vSelectedBitmap.GetWidth(); @@ -1754,12 +1753,10 @@ void wxDC::DrawAnyText( const wxString& rsText, vPtlStart.y = vY; } - PCH pzStr = (PCH)rsText.c_str(); - ::GpiMove(m_hPS, &vPtlStart); lHits = ::GpiCharString( m_hPS ,rsText.length() - ,pzStr + ,rsText.char_str() ); if (lHits != GPI_OK) { @@ -2154,7 +2151,7 @@ void wxDC::DoGetTextExtent( , wxCoord* pvY , wxCoord* pvDescent , wxCoord* pvExternalLeading -, wxFont* pTheFont +, const wxFont* pTheFont ) const { POINTL avPoint[TXTBOX_COUNT]; @@ -2179,7 +2176,7 @@ void wxDC::DoGetTextExtent( // bRc = ::GpiQueryTextBox( m_hPS ,l - ,(PCH)rsString.c_str() + ,rsString.char_str() ,TXTBOX_COUNT // return maximum information ,avPoint // array of coordinates points ); @@ -2297,6 +2294,9 @@ void wxDC::SetMapMode( m_nWindowExtX = (int)MS_XDEV2LOG(VIEWPORT_EXTENT); m_nWindowExtY = (int)MS_YDEV2LOG(VIEWPORT_EXTENT); // ???? + + ComputeScaleAndOrigin(); + }; // end of wxDC::SetMapMode void wxDC::SetUserScale( double dX, @@ -2317,17 +2317,6 @@ void wxDC::SetAxisOrientation( bool bXLeftRight, SetMapMode(m_mappingMode); } // end of wxDC::SetAxisOrientation -void wxDC::SetSystemScale( - double dX -, double dY -) -{ - m_scaleX = dX; - m_scaleY = dY; - - SetMapMode(m_mappingMode); -} // end of wxDC::SetSystemScale - void wxDC::SetLogicalOrigin( wxCoord vX , wxCoord vY @@ -2368,54 +2357,6 @@ void wxDC::SetDeviceOrigin( ); }; // end of wxDC::SetDeviceOrigin -// --------------------------------------------------------------------------- -// coordinates transformations -// --------------------------------------------------------------------------- - -wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const -{ - return (wxCoord) (((x) - m_deviceOriginX)/(m_logicalScaleX*m_userScaleX*m_signX*m_scaleX) - m_logicalOriginX); -} - -wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const -{ - // 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 -{ - return (wxCoord) (((y) - m_deviceOriginY)/(m_logicalScaleY*m_userScaleY*m_signY*m_scaleY) - m_logicalOriginY); -} - -wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const -{ - // 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 -{ - return (wxCoord) ((x - m_logicalOriginX)*m_logicalScaleX*m_userScaleX*m_signX*m_scaleX + m_deviceOriginX); -} - -wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const -{ - // 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 -{ - return (wxCoord) ((y - m_logicalOriginY)*m_logicalScaleY*m_userScaleY*m_signY*m_scaleY + m_deviceOriginY); -} - -wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const -{ - // axis orientation is not taken into account for conversion of a distance - return (wxCoord) (y*m_logicalScaleY*m_userScaleY*m_scaleY); -} - // --------------------------------------------------------------------------- // bit blit // ---------------------------------------------------------------------------