diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/text.c | 4 | ||||
-rw-r--r-- | src/ui/text_simple.c | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/ui/text.c b/src/ui/text.c index fc552db9..116c5eba 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -1882,7 +1882,7 @@ iInt2 tryAdvance_Text(int fontId, iRangecc text, int width, const char **endPos) | |||
1882 | } | 1882 | } |
1883 | 1883 | ||
1884 | iInt2 tryAdvanceNoWrap_Text(int fontId, iRangecc text, int width, const char **endPos) { | 1884 | iInt2 tryAdvanceNoWrap_Text(int fontId, iRangecc text, int width, const char **endPos) { |
1885 | if (width <= 1) { | 1885 | if (width && width <= 1) { |
1886 | *endPos = text.start; | 1886 | *endPos = text.start; |
1887 | return zero_I2(); | 1887 | return zero_I2(); |
1888 | } | 1888 | } |
@@ -2081,7 +2081,7 @@ iTextMetrics draw_WrapText(iWrapText *d, int fontId, iInt2 pos, int color) { | |||
2081 | const int width = d->mode == word_WrapTextMode | 2081 | const int width = d->mode == word_WrapTextMode |
2082 | ? tryAdvance_Text(fontId, text, d->maxWidth, &endPos).x | 2082 | ? tryAdvance_Text(fontId, text, d->maxWidth, &endPos).x |
2083 | : tryAdvanceNoWrap_Text(fontId, text, d->maxWidth, &endPos).x; | 2083 | : tryAdvanceNoWrap_Text(fontId, text, d->maxWidth, &endPos).x; |
2084 | notify_WrapText_(d, endPos, (iTextAttrib){ .colorId = color }, 0, width); | 2084 | notify_WrapText_(d, endPos, (iTextAttrib){ .fgColorId = color }, 0, width); |
2085 | drawRange_Text(fontId, pos, color, (iRangecc){ text.start, endPos }); | 2085 | drawRange_Text(fontId, pos, color, (iRangecc){ text.start, endPos }); |
2086 | text.start = endPos; | 2086 | text.start = endPos; |
2087 | pos.y += lineHeight_Text(fontId); | 2087 | pos.y += lineHeight_Text(fontId); |
diff --git a/src/ui/text_simple.c b/src/ui/text_simple.c index 81fb94a5..8560c138 100644 --- a/src/ui/text_simple.c +++ b/src/ui/text_simple.c | |||
@@ -61,7 +61,7 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) { | |||
61 | and other non-complex LTR scripts. Composed glyphs are not supported (must rely on text | 61 | and other non-complex LTR scripts. Composed glyphs are not supported (must rely on text |
62 | being in a pre-composed form). This algorithm is used if HarfBuzz is not available. */ | 62 | being in a pre-composed form). This algorithm is used if HarfBuzz is not available. */ |
63 | const iInt2 orig = args->pos; | 63 | const iInt2 orig = args->pos; |
64 | iTextAttrib attrib = { .colorId = args->color }; | 64 | iTextAttrib attrib = { .fgColorId = args->color }; |
65 | iRect bounds = { orig, init_I2(0, d->height) }; | 65 | iRect bounds = { orig, init_I2(0, d->height) }; |
66 | float xpos = orig.x; | 66 | float xpos = orig.x; |
67 | float xposMax = xpos; | 67 | float xposMax = xpos; |
@@ -118,8 +118,9 @@ static iRect runSimple_Font_(iFont *d, const iRunArgs *args) { | |||
118 | if (match_RegExp(activeText_->ansiEscape, chPos, args->text.end - chPos, &m)) { | 118 | if (match_RegExp(activeText_->ansiEscape, chPos, args->text.end - chPos, &m)) { |
119 | if (mode & draw_RunMode && ~mode & permanentColorFlag_RunMode) { | 119 | if (mode & draw_RunMode && ~mode & permanentColorFlag_RunMode) { |
120 | /* Change the color. */ | 120 | /* Change the color. */ |
121 | const iColor clr = | 121 | iColor clr; |
122 | ansiForeground_Color(capturedRange_RegExpMatch(&m, 1), tmParagraph_ColorId); | 122 | ansiColors_Color(capturedRange_RegExpMatch(&m, 1), tmParagraph_ColorId, |
123 | none_ColorId, &clr, NULL); | ||
123 | SDL_SetTextureColorMod(activeText_->cache, clr.r, clr.g, clr.b); | 124 | SDL_SetTextureColorMod(activeText_->cache, clr.r, clr.g, clr.b); |
124 | if (args->mode & fillBackground_RunMode) { | 125 | if (args->mode & fillBackground_RunMode) { |
125 | SDL_SetRenderDrawColor(activeText_->render, clr.r, clr.g, clr.b, 0); | 126 | SDL_SetRenderDrawColor(activeText_->render, clr.r, clr.g, clr.b, 0); |