]> git.saurik.com Git - wxWidgets.git/blobdiff - src/richtext/richtextformatdlg.cpp
correct typo in one of the last changes
[wxWidgets.git] / src / richtext / richtextformatdlg.cpp
index 3a7d7ee6c5196ce2f5de4ac195f3fd870a51ca77..d45b0cae23be170109c978692c16dbefec00f4cd 100644 (file)
@@ -411,6 +411,12 @@ void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
     wxSize size = GetSize();
     wxFont font = GetFont();
 
+    if ((GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT) || (GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT))
+    {
+        double size = static_cast<double>(font.GetPointSize()) / wxSCRIPT_MUL_FACTOR;
+        font.SetPointSize( static_cast<int>(size) );
+    }
+
     if ( font.Ok() )
     {
         dc.SetFont(font);
@@ -425,6 +431,11 @@ void wxRichTextFontPreviewCtrl::OnPaint(wxPaintEvent& WXUNUSED(event))
         int cx = wxMax(2, (size.x/2) - (w/2));
         int cy = wxMax(2, (size.y/2) - (h/2));
 
+        if ( GetTextEffects() & wxTEXT_ATTR_EFFECT_SUPERSCRIPT )
+            cy -= h/2;
+        if ( GetTextEffects() & wxTEXT_ATTR_EFFECT_SUBSCRIPT )
+            cy += h/2;
+
         dc.SetTextForeground(GetForegroundColour());
         dc.SetClippingRegion(2, 2, size.x-4, size.y-4);
         dc.DrawText(text, cx, cy);