Fixed an additional issue where font textures were sometimes updated with empty glyhps

This commit is contained in:
Leon Styhre 2023-11-20 23:15:01 +01:00
parent 1d6701ca4c
commit 498bdbd119

View file

@ -648,8 +648,10 @@ void Font::rebuildTextures()
static_cast<int>(it->second.texSize.y * tex->textureSize.y)};
// Upload to texture.
mRenderer->updateTexture(tex->textureId, 0, Renderer::TextureType::RED, cursor.x, cursor.y,
glyphSize.x, glyphSize.y, glyphSlot->bitmap.buffer);
if (glyphSize.x > 0 && glyphSize.y > 0) {
mRenderer->updateTexture(tex->textureId, 0, Renderer::TextureType::RED, cursor.x,
cursor.y, glyphSize.x, glyphSize.y, glyphSlot->bitmap.buffer);
}
}
}