Browse Source

Don't skip white space in nvgTextBreakLines().

master
Andrew Belt 8 months ago
parent
commit
0bebdb314a
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/nanovg.c

+ 3
- 2
src/nanovg.c View File

@@ -2770,7 +2770,8 @@ int nvgTextBreakLines(NVGcontext* ctx, const char* string, const char* end, floa
} else {
if (rowStart == NULL) {
// Skip white space until the beginning of the line
if (type == NVG_CHAR || type == NVG_CJK_CHAR) {
// HACK Disable skipping white space behavior.
if (type == NVG_CHAR || type == NVG_CJK_CHAR || type == NVG_SPACE) {
// The current char is the row so far
rowStartX = iter.x;
rowStart = iter.str;
@@ -2790,7 +2791,7 @@ int nvgTextBreakLines(NVGcontext* ctx, const char* string, const char* end, floa
float nextWidth = iter.nextx - rowStartX;

// track last non-white space character
if (type == NVG_CHAR || type == NVG_CJK_CHAR) {
if (type == NVG_CHAR || type == NVG_CJK_CHAR || type == NVG_SPACE) {
rowEnd = iter.next;
rowWidth = iter.nextx - rowStartX;
rowMaxX = q.x1 - rowStartX;


Loading…
Cancel
Save