summaryrefslogtreecommitdiff
path: root/src/ui/text.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/text.c')
-rw-r--r--src/ui/text.c4
1 files changed, 2 insertions, 2 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
1884iInt2 tryAdvanceNoWrap_Text(int fontId, iRangecc text, int width, const char **endPos) { 1884iInt2 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);