dB display truncated on the left at big zoom levels + Realign TextPanel font choice on existing fonts because scaling is quite ugly

This commit is contained in:
vsonnier
2016-06-24 20:44:35 +02:00
parent f9b394e1ef
commit 07102caf54
4 changed files with 29 additions and 15 deletions
+21 -8
View File
@@ -404,16 +404,29 @@ void GLTextPanel::drawPanelContents() {
//pdimy is considered un-scaled
pdimy = round(pdimy / appliedScaleFactor);
//target font size: a bit smaller than pdimy:
int sz = 12;
int size = 12;
if (pdimy > 14) {
//make the font a little smaller that the TextPanel
sz = pdimy - 2;
if (pdimy <= 16) {
size = 12;
} else if (pdimy <= 18) {
size = 16;
} else if(pdimy <= 24) {
size = 18;
} else if(pdimy <= 32) {
size = 24;
} else if(pdimy <= 48) {
size = 32;
} else {
size = 48;
}
}
GLFont::getFont(sz, appliedScaleFactor).drawString(textVal, mid, mid, horizAlign, vertAlign, (int)pdim.x, (int)pdim.y);
GLFont::getFont(size, appliedScaleFactor).drawString(textVal, mid, mid, horizAlign, vertAlign, (int)pdim.x, (int)pdim.y);
}
void GLTextPanel::setText(std::string text, GLFont::Align hAlign, GLFont::Align vAlign, bool useNative) {