Skip to content

Commit

Permalink
STANDOUT fix: switching from inverting raw colors to inverting foregr…
Browse files Browse the repository at this point in the history
…ound/background colors
  • Loading branch information
dmalec committed Dec 31, 2021
1 parent d5109ae commit f583622
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions wxTerminal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1983,22 +1983,23 @@ wxTerminal::DrawText(wxDC& dc, int fg_color, int bg_color, int flags,
}

int coord_x, coord_y;
bool normal_colors = true;

This comment has been minimized.

Copy link
@jrincayc

jrincayc Dec 31, 2021

Owner

Could this be normal_colors = !(flags & INVERSE) and then change the logic below if(!normal_colors) and a plain else?

dc.SetBackgroundMode(wxSOLID);
dc.SetTextBackground(TurtleCanvas::colors[bg_color]);
dc.SetTextForeground(TurtleCanvas::colors[fg_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);
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);
for (unsigned int i = 0; i < str.Length(); i++, coord_x+=m_charWidth) {
if ((flags & INVERSE) && normal_colors) {
dc.SetTextBackground(TurtleCanvas::colors[fg_color]);
dc.SetTextForeground(TurtleCanvas::colors[bg_color]);
} else if (!(flags & INVERSE) && !normal_colors) {
dc.SetTextBackground(TurtleCanvas::colors[bg_color]);
dc.SetTextForeground(TurtleCanvas::colors[fg_color]);
}

dc.DrawText(str.Mid(i, 1), coord_x, coord_y);
}
}

Expand Down

0 comments on commit f583622

Please sign in to comment.