From d23f59a3c9038970405b36949a681c1f1e82e493 Mon Sep 17 00:00:00 2001 From: "Charles J. Cliffe" Date: Thu, 28 Jul 2016 18:36:33 -0400 Subject: [PATCH] Tuning bar font tweak for width changes --- src/visual/TuningContext.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/visual/TuningContext.cpp b/src/visual/TuningContext.cpp index bef18a7..58f49de 100644 --- a/src/visual/TuningContext.cpp +++ b/src/visual/TuningContext.cpp @@ -68,6 +68,7 @@ void TuningContext::DrawTuner(long long freq, int count, float displayPos, float GLint vp[4]; glGetIntegerv( GL_VIEWPORT, vp); + float viewWidth = (float) vp[2]; float viewHeight = (float) vp[3]; freqStr.str(""); @@ -76,20 +77,20 @@ void TuningContext::DrawTuner(long long freq, int count, float displayPos, float int fontSize = 32; - if (viewHeight < 28) { + if (viewWidth < 300) { fontSize = 18; - - } - if (viewHeight < 24) { - fontSize = 16; - + } else if (viewWidth < 500) { + fontSize = 24; } + if (viewHeight < 18) { fontSize = 12; - + } else if (viewHeight < 24) { + fontSize = 16; + } else if (viewHeight < 28) { + fontSize = 18; } - glColor3f(ThemeMgr::mgr.currentTheme->text.r, ThemeMgr::mgr.currentTheme->text.g, ThemeMgr::mgr.currentTheme->text.b); int numChars = freqChars.length(); int ofs = count - numChars;