Avoid creating zero-size fonts (seems to be because of an init order problem during app switching)

This commit is contained in:
Henrik Rydgård committed 2026-04-28 22:18:16 +02:00
1 parent e0a5a3e2bf
commit 771f2b3fe0
2 files changed
+5

No files matched your search

+4
View File
@@ -138,6 +138,10 @@ TextDrawerCocoa::~TextDrawerCocoa() {
// TODO: Share with other backends.
void TextDrawerCocoa::SetOrCreateFont(const FontStyle &style) {
if (style.sizePts <= 0) {
return;
}
auto iter = fontMap_.find(style);
if (iter != fontMap_.end()) {
fontStyle_ = style;
+1
View File
@@ -1089,6 +1089,7 @@ const FontStyle *GetTextStyle(const UIContext &dc, TextSize size) {
default:
break;
}
_dbg_assert_(style->sizePts > 0);
return style;
}