Bitmap: Prevent one-pixel squeeze
This likely happens because the game doesn't take the shadow into account, and specifies the target rectangle one pixel too narrow.
This commit is contained in:
parent
ef06c8eca4
commit
3eb5465c93
|
@ -1186,7 +1186,9 @@ void Bitmap::drawText(const IntRect &rect, const char *str, int align)
|
|||
|
||||
float squeeze = (float) rect.w / txtSurf->w;
|
||||
|
||||
if (squeeze > 1)
|
||||
// If we're off by one pixel, it's likely that some bitmap was allocated
|
||||
// without taking the shadow size into account
|
||||
if (squeeze > 1 || txtSurf->w - rect.w == 1)
|
||||
squeeze = 1;
|
||||
|
||||
FloatRect posRect(alignX, alignY, txtSurf->w * squeeze, txtSurf->h);
|
||||
|
|
Loading…
Reference in New Issue