From fc58c6be4e057ac9664262c82d4d528f21b2bfdc Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 24 Oct 2004 12:48:00 +0000 Subject: [PATCH] corrected textbackground for theme text output git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dc.cpp | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/src/mac/carbon/dc.cpp b/src/mac/carbon/dc.cpp index 3084e7224c..6ba16965dc 100644 --- a/src/mac/carbon/dc.cpp +++ b/src/mac/carbon/dc.cpp @@ -1321,17 +1321,12 @@ inline int FixedToInt( Fixed inFixed ) void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y, double angle) { + // TODO support text background color (only possible by hand, ATSUI does not support it) wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText Invalid window dc") ); -/* - if (angle == 0.0 ) - { - DrawText(str, x, y); - return; - } if ( str.Length() == 0 ) return ; -*/ + wxMacFastPortSetter helper(this) ; MacInstallFont() ; @@ -1434,12 +1429,7 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) useDrawThemeText = false ; #endif MacInstallFont() ; - if ( 0 ) - { - m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize); - SetAntiAliasedTextEnabled(true, 8); - m_macAliasWasEnabled = true ; - } + FontInfo fi ; ::GetFontInfo( &fi ) ; #if TARGET_CARBON @@ -1491,14 +1481,6 @@ void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y) #endif { wxCharBuffer text = linetext.mb_str(wxConvLocal) ; - if ( m_backgroundMode != wxTRANSPARENT ) - { - Rect frame = { yy - fi.ascent + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy - fi.ascent + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ; - short width = ::TextWidth( text , 0 , strlen(text) ) ; - frame.right = frame.left + width ; - - ::EraseRect( &frame ) ; - } ::DrawText( text , 0 , strlen(text) ) ; } } @@ -1701,6 +1683,11 @@ void wxDC::MacInstallFont() const // return ; Pattern blackColor ; MacSetupBackgroundForCurrentPort(m_backgroundBrush) ; + if ( m_backgroundMode != wxTRANSPARENT ) + { + Pattern whiteColor ; + ::BackPat(GetQDGlobalsWhite(&whiteColor)); + } if ( m_font.Ok() ) { ::TextFont( m_font.MacGetFontNum() ) ; -- 2.47.2