summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2020-12-13 11:21:15 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2020-12-13 11:21:15 +0200
commit730540332cbeaf949263bdf5dae5714688f0d10a (patch)
treede4b43f58cc40848643cdd6a296913537b943ab9
parent71699b5095d1acb01946537cdc7aa4022c28a126 (diff)
Fixed UI text color regression
-rw-r--r--res/about/version.gmi3
-rw-r--r--src/ui/text.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/res/about/version.gmi b/res/about/version.gmi
index d91de9ff..868d2ac3 100644
--- a/res/about/version.gmi
+++ b/res/about/version.gmi
@@ -6,6 +6,9 @@
6``` 6```
7# Release notes 7# Release notes
8 8
9## 0.13.2
10* Fixed incorrect text colors in the UI (e.g., selected lookup result).
11
9## 0.13.1 12## 0.13.1
10* Fixed build failure on Linux. 13* Fixed build failure on Linux.
11 14
diff --git a/src/ui/text.c b/src/ui/text.c
index c36fceb5..231c2976 100644
--- a/src/ui/text.c
+++ b/src/ui/text.c
@@ -658,7 +658,7 @@ static iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe
658 iRegExpMatch m; 658 iRegExpMatch m;
659 init_RegExpMatch(&m); 659 init_RegExpMatch(&m);
660 if (match_RegExp(text_.ansiEscape, chPos, text.end - chPos, &m)) { 660 if (match_RegExp(text_.ansiEscape, chPos, text.end - chPos, &m)) {
661 if (mode & draw_RunMode) { 661 if (mode & draw_RunMode && ~mode & permanentColorFlag_RunMode) {
662 /* Change the color. */ 662 /* Change the color. */
663 const iColor clr = 663 const iColor clr =
664 ansiForeground_Color(capturedRange_RegExpMatch(&m, 1), tmParagraph_ColorId); 664 ansiForeground_Color(capturedRange_RegExpMatch(&m, 1), tmParagraph_ColorId);
@@ -729,7 +729,7 @@ static iRect run_Font_(iFont *d, enum iRunMode mode, iRangecc text, size_t maxLe
729 } 729 }
730 if (ch == '\r') { 730 if (ch == '\r') {
731 const iChar esc = nextChar_(&chPos, text.end); 731 const iChar esc = nextChar_(&chPos, text.end);
732 if (mode & draw_RunMode) { 732 if (mode & draw_RunMode && ~mode & permanentColorFlag_RunMode) {
733 const iColor clr = get_Color(esc - asciiBase_ColorEscape); 733 const iColor clr = get_Color(esc - asciiBase_ColorEscape);
734 SDL_SetTextureColorMod(text_.cache, clr.r, clr.g, clr.b); 734 SDL_SetTextureColorMod(text_.cache, clr.r, clr.g, clr.b);
735 } 735 }