fix: missing font usage produces fatal error

This commit is contained in:
MihailRis 2026-07-22 22:48:16 +03:00
parent 5284d4acaa
commit 420d0daf28
3 changed files with 8 additions and 3 deletions

View file

@ -353,7 +353,9 @@ void TextBox::draw(const DrawContext& pctx, const Assets& assets) {
void TextBox::drawBackground(const DrawContext& pctx, const Assets& assets) {
auto font = assets.getShared<Font>(label->getFontName());
rawTextCache.prepare(font, font->getMetrics(), label->getSize().x);
if (font != nullptr) {
rawTextCache.prepare(font, font->getMetrics(), label->getSize().x);
}
glm::vec2 pos = calcPos();