From f687d4824bae0d7191e55e23bc6365476f39f81d Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Mon, 11 Jan 2021 16:41:15 +0100 Subject: [PATCH] sculpt: set lower bound for font size --- repos/gems/src/app/sculpt_manager/main.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/repos/gems/src/app/sculpt_manager/main.cc b/repos/gems/src/app/sculpt_manager/main.cc index 05bd1ca5af..d20576f227 100644 --- a/repos/gems/src/app/sculpt_manager/main.cc +++ b/repos/gems/src/app/sculpt_manager/main.cc @@ -1315,6 +1315,12 @@ void Sculpt::Main::_handle_gui_mode() _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::LARGE) _font_size_px *= 1.35;