mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Reset text containers on language change
Fix text containers rendering broken text after the language is changed, as this cleared the glyph atlas without clearing the references to the glyph positions in the text containers. Now `OnWindowResize` is also called on language change to reset all text containers. However, the glyph atlas is not cleared on normal window resize anymore, because this seems to be unnecessary.
This commit is contained in:
parent
b9355880b3
commit
f90e908c9d
|
@ -2341,8 +2341,6 @@ public:
|
|||
}
|
||||
|
||||
dbg_assert(!HasNonEmptyTextContainer, "text container was not empty");
|
||||
|
||||
m_pGlyphMap->Clear();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -990,7 +990,8 @@ void CGameClient::HandleLanguageChanged()
|
|||
g_Localization.Load(g_Config.m_ClLanguagefile, Storage(), Console());
|
||||
TextRender()->SetFontLanguageVariant(g_Config.m_ClLanguagefile);
|
||||
|
||||
UI()->OnLanguageChange();
|
||||
// Clear all text containers
|
||||
OnWindowResize();
|
||||
}
|
||||
|
||||
void CGameClient::RenderShutdownMessage()
|
||||
|
|
|
@ -174,11 +174,6 @@ void CUI::OnWindowResize()
|
|||
OnElementsReset();
|
||||
}
|
||||
|
||||
void CUI::OnLanguageChange()
|
||||
{
|
||||
OnElementsReset();
|
||||
}
|
||||
|
||||
void CUI::OnCursorMove(float X, float Y)
|
||||
{
|
||||
if(!CheckMouseLock())
|
||||
|
|
|
@ -390,7 +390,6 @@ public:
|
|||
void AddUIElement(CUIElement *pElement);
|
||||
void OnElementsReset();
|
||||
void OnWindowResize();
|
||||
void OnLanguageChange();
|
||||
void OnCursorMove(float X, float Y);
|
||||
|
||||
void SetEnabled(bool Enabled) { m_Enabled = Enabled; }
|
||||
|
|
Loading…
Reference in a new issue