X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2fce6547622ff5f9e4ec31372b0f6172e87edefa..2028c33ab5a39a12bd410ac953731a56ad6377ba:/src/richtext/richtextformatdlg.cpp?ds=sidebyside diff --git a/src/richtext/richtextformatdlg.cpp b/src/richtext/richtextformatdlg.cpp index 3a7d7ee6c5..08c20f18d2 100644 --- a/src/richtext/richtextformatdlg.cpp +++ b/src/richtext/richtextformatdlg.cpp @@ -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(font.GetPointSize()) / wxSCRIPT_MUL_FACTOR; + font.SetPointSize( static_cast(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); @@ -488,7 +499,6 @@ wxRichTextColourSwatchCtrl::wxRichTextColourSwatchCtrl(wxWindow* parent, wxWindo wxControl::Create(parent, id, pos, size, style); SetColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - SetBackgroundStyle(wxBG_STYLE_COLOUR); } wxRichTextColourSwatchCtrl::~wxRichTextColourSwatchCtrl()