Skip to content

Commit

Permalink
Fixed bug with logging preamble/postamble sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgammon committed Sep 30, 2012
1 parent 19345c3 commit 04f9185
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ProcessPreviousLine.cpp
Expand Up @@ -73,12 +73,18 @@ void CMUSHclientDoc::LogLineInHTMLcolour (POSITION startpos)
bInSpan = false;
}

WriteToLog (CFormat ("</font><font color=\"#%02X%02X%02X\">",
// wrap up last colour change
if (prevcolour != NO_COLOUR)
WriteToLog ("</font>");

WriteToLog (CFormat ("<font color=\"#%02X%02X%02X\">",
GetRValue (colour1),
GetGValue (colour1),
GetBValue (colour1)
));

prevcolour = colour1;

// for efficiency we will only use <span> if we need to change the
// background colour
if (colour2 != 0) // ie. not black
Expand Down Expand Up @@ -122,7 +128,7 @@ void CMUSHclientDoc::LogLineInHTMLcolour (POSITION startpos)
WriteToLog ("</span>");

// wrap up last colour change
if (prevcolour != -1)
if (prevcolour != NO_COLOUR)
WriteToLog ("</font>");

} // end of CMUSHclientDoc::LogLineInHTMLcolour
Expand Down

0 comments on commit 04f9185

Please sign in to comment.