Add: {PUSH_COLOUR} and {POP_COLOUR} control codes to handle switching colours. (#6737)

This replaces the internal SCC_PREVIOUS_COLOUR swap.
This commit is contained in:
PeterN
2018-04-19 19:33:21 +01:00
committed by GitHub
parent f4f9e18790
commit 3b32075e8a
5 changed files with 33 additions and 13 deletions

View File

@@ -594,8 +594,10 @@ static inline void GetLayouter(Layouter::LineCacheItem &line, const char *&str,
break;
} else if (c >= SCC_BLUE && c <= SCC_BLACK) {
state.SetColour((TextColour)(c - SCC_BLUE));
} else if (c == SCC_PREVIOUS_COLOUR) { // Revert to the previous colour.
state.SetPreviousColour();
} else if (c == SCC_PUSH_COLOUR) {
state.PushColour();
} else if (c == SCC_POP_COLOUR) {
state.PopColour();
} else if (c >= SCC_FIRST_FONT && c <= SCC_LAST_FONT) {
state.SetFontSize((FontSize)(c - SCC_FIRST_FONT));
} else {