Try to avoid the split point jumping around when it occurs exactly on the boundary requested

This commit is contained in:
Chris Young 2013-05-18 13:34:36 +01:00
parent 13e667ff78
commit 5fcdbb80f0
1 changed files with 2 additions and 3 deletions

View File

@ -341,15 +341,14 @@ bool nsfont_split(const plot_font_style_t *fstyle,
} }
} }
tx += tempx;
if ((x < tx) && (*char_offset != 0)) { if ((x < tx) && (*char_offset != 0)) {
/* Reached available width, and a space was found; /* Reached available width, and a space was found;
* split there. */ * split there. */
free(outf16); free(outf16);
return true; return true;
} }
tx += tempx;
utf16 = utf16next; utf16 = utf16next;
utf8_pos = utf8_next(string, length, utf8_pos); utf8_pos = utf8_next(string, length, utf8_pos);
} }