less whitespace

master
Nat! 2020-12-21 10:59:15 +01:00
parent 621e0b8d35
commit 0faac6f91a
1 changed files with 5 additions and 6 deletions

View File

@ -2454,7 +2454,7 @@ static void nvg__renderText(NVGcontext* ctx, NVGvertex* verts, int nverts)
ctx->textTriCount += nverts/3;
}
static int nvg__isTransformFlipped( const float *xform)
static int nvg__isTransformFlipped(const float *xform)
{
float det = xform[0] * xform[3] - xform[2] * xform[1];
return( det < 0);
@ -2470,8 +2470,7 @@ float nvgText(NVGcontext* ctx, float x, float y, const char* string, const char*
float invscale = 1.0f / scale;
int cverts = 0;
int nverts = 0;
int isFlipped;
float tmp;
int isFlipped = nvg__isTransformFlipped(xform);
if (end == NULL)
end = string + strlen(string);
@ -2488,7 +2487,6 @@ float nvgText(NVGcontext* ctx, float x, float y, const char* string, const char*
verts = nvg__allocTempVerts(ctx, cverts);
if (verts == NULL) return x;
isFlipped = nvg__isTransformFlipped( state->xform);
fonsTextIterInit(ctx->fs, &iter, x*scale, y*scale, string, end, FONS_GLYPH_BITMAP_REQUIRED);
prevIter = iter;
while (fonsTextIterNext(ctx->fs, &iter, &q)) {
@ -2506,8 +2504,9 @@ float nvgText(NVGcontext* ctx, float x, float y, const char* string, const char*
break;
}
prevIter = iter;
if( isFlipped)
{
if(isFlipped) {
float tmp;
tmp = q.y0; q.y0 = q.y1; q.y1 = tmp;
tmp = q.t0; q.t0 = q.t1; q.t1 = tmp;
}