|
|
@@ -30,6 +30,12 @@ |
|
|
|
#include "stb_image.h" |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef NVG_DISABLE_SKIPPING_WHITESPACE |
|
|
|
#define NVG_SKIPPED_CHAR NVG_SPACE |
|
|
|
#else |
|
|
|
#define NVG_SKIPPED_CHAR NVG_CHAR |
|
|
|
#endif |
|
|
|
|
|
|
|
#ifdef _MSC_VER |
|
|
|
#pragma warning(disable: 4100) // unreferenced formal parameter |
|
|
|
#pragma warning(disable: 4127) // conditional expression is constant |
|
|
@@ -2775,7 +2781,7 @@ 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) { |
|
|
|
if (type == NVG_CHAR || type == NVG_CJK_CHAR || type == NVG_SKIPPED_CHAR) { |
|
|
|
// The current char is the row so far |
|
|
|
rowStartX = iter.x; |
|
|
|
rowStart = iter.str; |
|
|
@@ -2795,7 +2801,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_SKIPPED_CHAR) { |
|
|
|
rowEnd = iter.next; |
|
|
|
rowWidth = iter.nextx - rowStartX; |
|
|
|
rowMaxX = q.x1 - rowStartX; |
|
|
|