Merge pull request #741 from Jarreddebeer/yoffset_distancefieldfont

correction to yoffset char positions in distance field fonts example
This commit is contained in:
Sascha Willems 2020-07-15 06:55:17 +02:00 committed by GitHub
commit 3d347adf30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -285,7 +285,6 @@ public:
float dimx = 1.0f * charw;
float charh = ((float)(charInfo->height) / 36.0f);
float dimy = 1.0f * charh;
posy = 1.0f - charh;
float us = charInfo->x / w;
float ue = (charInfo->x + charInfo->width) / w;
@ -295,6 +294,8 @@ public:
float xo = charInfo->xoffset / 36.0f;
float yo = charInfo->yoffset / 36.0f;
posy = yo;
vertices.push_back({ { posx + dimx + xo, posy + dimy, 0.0f }, { ue, te } });
vertices.push_back({ { posx + xo, posy + dimy, 0.0f }, { us, te } });
vertices.push_back({ { posx + xo, posy, 0.0f }, { us, ts } });