diff --git a/wxTerminal.cpp b/wxTerminal.cpp index d011feb..790027b 100644 --- a/wxTerminal.cpp +++ b/wxTerminal.cpp @@ -1970,22 +1970,22 @@ wxTerminal::DrawText(wxDC& dc, int fg_color, int bg_color, int flags, } int coord_x, coord_y; + bool normal_colors = !(flags & INVERSE); + dc.SetBackgroundMode(wxSOLID); - dc.SetTextBackground(TurtleCanvas::colors[bg_color]); - dc.SetTextForeground(TurtleCanvas::colors[fg_color]); + if (normal_colors) { + dc.SetTextBackground(TurtleCanvas::colors[bg_color]); + dc.SetTextForeground(TurtleCanvas::colors[fg_color]); + } else { + dc.SetTextBackground(TurtleCanvas::colors[fg_color]); + dc.SetTextForeground(TurtleCanvas::colors[bg_color]); + } + coord_y = y * m_charHeight; coord_x = x * (m_charWidth); - for(unsigned int i = 0; i < str.Length(); i++, coord_x+=m_charWidth){ - //clear the pixels first - //dc.Blit(coord_x, coord_y, m_charWidth, m_charHeight, &dc, coord_x, coord_y, wxCLEAR); + for (unsigned int i = 0; i < str.Length(); i++, coord_x += m_charWidth) { dc.DrawText(str.Mid(i, 1), coord_x, coord_y); - // if(flags & BOLD && m_boldStyle == OVERSTRIKE) - // dc.DrawText(str, x + 1, y); - if(flags & INVERSE) { - InvertArea(dc, coord_x, coord_y, m_charWidth, m_charHeight); - // dc.Blit( coord_x, coord_y, m_charWidth, m_charHeight, &dc, coord_x, coord_y, wxINVERT); - } } }