]> git.saurik.com Git - wxWidgets.git/commitdiff
corrected textbackground for theme text output
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 24 Oct 2004 12:48:00 +0000 (12:48 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 24 Oct 2004 12:48:00 +0000 (12:48 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/dc.cpp

index 3084e7224c6ca38171758d40d6a6449cc8dc5d45..6ba16965dcf25f037a176bb045e3ba43fffc7fc9 100644 (file)
@@ -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() ) ;