mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Fix crash if display resolution is not set (#7950)
On my wayland / gnome3 setup DisplayHeightMM() returns 0. This resulted in a misleading startup error suggesting to fix my font paths.
This commit is contained in:
@@ -315,6 +315,11 @@ void FontEngine::initFont(unsigned int basesize, FontMode mode)
|
||||
}
|
||||
u32 size = std::floor(RenderingEngine::getDisplayDensity() *
|
||||
m_settings->getFloat("gui_scaling") * basesize);
|
||||
if (size == 0) {
|
||||
errorstream << "FontEngine: attempt to use font size 0" << std::endl;
|
||||
errorstream << " display density: " << RenderingEngine::getDisplayDensity() << std::endl;
|
||||
abort();
|
||||
}
|
||||
u32 font_shadow = 0;
|
||||
u32 font_shadow_alpha = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user