Bitmap: Fix vertical alignment for some letters with outline
This commit is contained in:
parent
91c9bfd0f4
commit
5379511d95
|
@ -992,6 +992,8 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
|
||||||
|
|
||||||
p->ensureFormat(txtSurf, SDL_PIXELFORMAT_ABGR8888);
|
p->ensureFormat(txtSurf, SDL_PIXELFORMAT_ABGR8888);
|
||||||
|
|
||||||
|
int rawTxtSurfH = txtSurf->h;
|
||||||
|
|
||||||
if (p->font->getShadow())
|
if (p->font->getShadow())
|
||||||
applyShadow(txtSurf, *p->format, c);
|
applyShadow(txtSurf, *p->format, c);
|
||||||
|
|
||||||
|
@ -1040,7 +1042,7 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
|
||||||
if (alignX < rect.x)
|
if (alignX < rect.x)
|
||||||
alignX = rect.x;
|
alignX = rect.x;
|
||||||
|
|
||||||
int alignY = rect.y + (rect.h - txtSurf->h) / 2;
|
int alignY = rect.y + (rect.h - rawTxtSurfH) / 2;
|
||||||
|
|
||||||
float squeeze = (float) rect.w / txtSurf->w;
|
float squeeze = (float) rect.w / txtSurf->w;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue