X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/66a09d4776b8ae390d5aa51dbd678b694f2c81d6..239c2e9674c8c6b9f0fd3d6fb94e2381691651b5:/src/mac/carbon/dc.cpp diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index aaabc6607b..bba19b5b4c 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -250,14 +250,14 @@ void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const { Pattern blackColor ; ::PenPat(GetQDGlobalsBlack(&blackColor)); - DisposePixMap( (PixMapHandle) m_macForegroundPixMap ) ; + DisposePixPat( (PixPatHandle) m_macForegroundPixMap ) ; m_macForegroundPixMap = NULL ; } if ( m_macBackgroundPixMap ) { Pattern whiteColor ; ::BackPat(GetQDGlobalsWhite(&whiteColor)); - DisposePixMap( (PixMapHandle) m_macBackgroundPixMap ) ; + DisposePixPat( (PixPatHandle) m_macBackgroundPixMap ) ; m_macBackgroundPixMap = NULL ; } } @@ -563,7 +563,11 @@ wxSize wxDC::GetPPI() const int wxDC::GetDepth() const { - return wxDisplayDepth() ; + if ( IsPortColor( (CGrafPtr) m_macPort ) ) + { + return ( (**GetPortPixMap( (CGrafPtr) m_macPort)).pixelSize ) ; + } + return 1 ; } void wxDC::ComputeScaleAndOrigin() @@ -1786,11 +1790,21 @@ void wxDC::MacInstallFont() const } +Pattern gHatchPatterns[] = +{ + { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } , + { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } , + { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } , + { 0x10 , 0x10 , 0x10 , 0xFF , 0x10 , 0x10 , 0x10 , 0x10 } , + { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } , + { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } , + { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } , +} ; + static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern) { - // we have our own pattern list now - int thePatListID = 128; - int theIndex; + int theIndex = 1 ; + switch(hatchStyle) { case wxBDIAGONAL_HATCH: @@ -1815,7 +1829,7 @@ static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern) theIndex = 1; // solid pattern break; } - GetIndPattern( pattern, thePatListID, theIndex); + *pattern = gHatchPatterns[theIndex-1] ; } void wxDC::MacInstallPen() const