diff --git a/src/richtext/richtextbuffer.cpp b/src/richtext/richtextbuffer.cpp index ec6f0c6f47..780445870b 100644 --- a/src/richtext/richtextbuffer.cpp +++ b/src/richtext/richtextbuffer.cpp @@ -4329,20 +4329,21 @@ bool wxRichTextPlainText::DrawTabbedString(wxDC& dc, const wxTextAttrEx& attr, c dc.SetBrush(*wxBLACK_BRUSH); dc.SetPen(*wxBLACK_PEN); dc.SetTextForeground(*wxWHITE); + dc.SetBackgroundMode(wxTRANSPARENT); } else { dc.SetTextForeground(attr.GetTextColour()); - } - if (attr.HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) && attr.GetBackgroundColour().IsOk()) - { - dc.SetBackgroundMode(wxSOLID); - dc.SetTextBackground(attr.GetBackgroundColour()); + if (attr.HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) && attr.GetBackgroundColour().IsOk()) + { + dc.SetBackgroundMode(wxSOLID); + dc.SetTextBackground(attr.GetBackgroundColour()); + } + else + dc.SetBackgroundMode(wxTRANSPARENT); } - else - dc.SetBackgroundMode(wxTRANSPARENT); - + while (hasTabs) { // the string has a tab