corrected GetDepth method and wrong disposal calls for pixmap

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13552 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Stefan Csomor
2002-01-13 19:16:14 +00:00
parent 66689a9ee9
commit c99d6f997c
2 changed files with 14 additions and 6 deletions

View File

@@ -250,14 +250,14 @@ void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
{ {
Pattern blackColor ; Pattern blackColor ;
::PenPat(GetQDGlobalsBlack(&blackColor)); ::PenPat(GetQDGlobalsBlack(&blackColor));
DisposePixMap( (PixMapHandle) m_macForegroundPixMap ) ; DisposePixPat( (PixPatHandle) m_macForegroundPixMap ) ;
m_macForegroundPixMap = NULL ; m_macForegroundPixMap = NULL ;
} }
if ( m_macBackgroundPixMap ) if ( m_macBackgroundPixMap )
{ {
Pattern whiteColor ; Pattern whiteColor ;
::BackPat(GetQDGlobalsWhite(&whiteColor)); ::BackPat(GetQDGlobalsWhite(&whiteColor));
DisposePixMap( (PixMapHandle) m_macBackgroundPixMap ) ; DisposePixPat( (PixPatHandle) m_macBackgroundPixMap ) ;
m_macBackgroundPixMap = NULL ; m_macBackgroundPixMap = NULL ;
} }
} }
@@ -563,7 +563,11 @@ wxSize wxDC::GetPPI() const
int wxDC::GetDepth() const int wxDC::GetDepth() const
{ {
return wxDisplayDepth() ; if ( IsPortColor( (CGrafPtr) m_macPort ) )
{
return ( (**GetPortPixMap( (CGrafPtr) m_macPort)).pixelSize ) ;
}
return 1 ;
} }
void wxDC::ComputeScaleAndOrigin() void wxDC::ComputeScaleAndOrigin()

View File

@@ -250,14 +250,14 @@ void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
{ {
Pattern blackColor ; Pattern blackColor ;
::PenPat(GetQDGlobalsBlack(&blackColor)); ::PenPat(GetQDGlobalsBlack(&blackColor));
DisposePixMap( (PixMapHandle) m_macForegroundPixMap ) ; DisposePixPat( (PixPatHandle) m_macForegroundPixMap ) ;
m_macForegroundPixMap = NULL ; m_macForegroundPixMap = NULL ;
} }
if ( m_macBackgroundPixMap ) if ( m_macBackgroundPixMap )
{ {
Pattern whiteColor ; Pattern whiteColor ;
::BackPat(GetQDGlobalsWhite(&whiteColor)); ::BackPat(GetQDGlobalsWhite(&whiteColor));
DisposePixMap( (PixMapHandle) m_macBackgroundPixMap ) ; DisposePixPat( (PixPatHandle) m_macBackgroundPixMap ) ;
m_macBackgroundPixMap = NULL ; m_macBackgroundPixMap = NULL ;
} }
} }
@@ -563,7 +563,11 @@ wxSize wxDC::GetPPI() const
int wxDC::GetDepth() const int wxDC::GetDepth() const
{ {
return wxDisplayDepth() ; if ( IsPortColor( (CGrafPtr) m_macPort ) )
{
return ( (**GetPortPixMap( (CGrafPtr) m_macPort)).pixelSize ) ;
}
return 1 ;
} }
void wxDC::ComputeScaleAndOrigin() void wxDC::ComputeScaleAndOrigin()