From 498bdbd11915be93c2f64165b62386f5a332a04a Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Mon, 20 Nov 2023 23:15:01 +0100 Subject: [PATCH] Fixed an additional issue where font textures were sometimes updated with empty glyhps --- es-core/src/resources/Font.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/es-core/src/resources/Font.cpp b/es-core/src/resources/Font.cpp index 3069aa467..76e1ac960 100644 --- a/es-core/src/resources/Font.cpp +++ b/es-core/src/resources/Font.cpp @@ -648,8 +648,10 @@ void Font::rebuildTextures() static_cast(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); + } } }