diff options
Diffstat (limited to 'src/ui/text.c')
-rw-r--r-- | src/ui/text.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ui/text.c b/src/ui/text.c index 8a82690f..27ed80ab 100644 --- a/src/ui/text.c +++ b/src/ui/text.c | |||
@@ -1561,8 +1561,18 @@ static iRect run_Font_(iFont *d, const iRunArgs *args) { | |||
1561 | } | 1561 | } |
1562 | if (isHitPointOnThisLine && wrap->hitPoint.x >= orig.x + wrapAdvance) { | 1562 | if (isHitPointOnThisLine && wrap->hitPoint.x >= orig.x + wrapAdvance) { |
1563 | /* On the right side. */ | 1563 | /* On the right side. */ |
1564 | wrap->hitChar_out = sourcePtr_AttributedText_(&attrText, iMax(0, wrapResumePos - 1)); | 1564 | if (wrapResumePos == textLen) { |
1565 | wrap->hitGlyphNormX_out = 1.0f; | 1565 | wrap->hitChar_out = sourcePtr_AttributedText_(&attrText, wrapResumePos); |
1566 | } | ||
1567 | else { | ||
1568 | const char *hit = sourcePtr_AttributedText_(&attrText, iMax(0, wrapResumePos - 1)); | ||
1569 | while (hit > args->text.start) { | ||
1570 | if (!isSpace_Char(hit[-1])) break; | ||
1571 | hit--; | ||
1572 | } | ||
1573 | wrap->hitChar_out = hit; | ||
1574 | } | ||
1575 | wrap->hitGlyphNormX_out = 0.0f; | ||
1566 | } | 1576 | } |
1567 | } | 1577 | } |
1568 | else { | 1578 | else { |