Skip to content

Commit

Permalink
Fix initial texture atlas size of fonts with high dpi scales
Browse files Browse the repository at this point in the history
  • Loading branch information
slime73 committed Jul 6, 2024
1 parent 0e517c2 commit c1fddfe
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/modules/graphics/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Font::Font(love::font::Rasterizer *r, const SamplerState &s)
// largest texture size if no rough match is found.
while (true)
{
if ((shaper->getHeight() * 0.8) * shaper->getHeight() * 30 <= textureWidth * textureHeight)
float dpiscale = r->getDPIScale();
if ((shaper->getHeight() * 0.8 * dpiscale) * shaper->getHeight() * 30 * dpiscale <= textureWidth * textureHeight)
break;

TextureSize nextsize = getNextTextureSize();
Expand Down

0 comments on commit c1fddfe

Please sign in to comment.