sculpt: set lower bound for font size

This commit is contained in:
Norman Feske 2021-01-11 16:41:15 +01:00
parent 0a478dac7f
commit f687d4824b

View File

@ -1315,6 +1315,12 @@ void Sculpt::Main::_handle_gui_mode()
_font_size_px = (float)mode.area.h() / 60.0; _font_size_px = (float)mode.area.h() / 60.0;
/*
* Limit lower bound of font size. Otherwise, the glyph rendering
* may suffer from division-by-zero problems.
*/
_font_size_px = max(_font_size_px, 2.0);
if (_font_size == Font_size::SMALL) _font_size_px *= 0.85; if (_font_size == Font_size::SMALL) _font_size_px *= 0.85;
if (_font_size == Font_size::LARGE) _font_size_px *= 1.35; if (_font_size == Font_size::LARGE) _font_size_px *= 1.35;