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
+4 -3
View File
@@ -851,7 +851,8 @@ GLFont::Drawer::Drawer(int basicFontSize, double scaleFactor) {
//final font size of basicFontSize* scaleFactor:
renderingFontIndex = 0;
double targetSize = basicFontSize * scaleFactor;
//try to align on an integer pixel size if the targetSize font is available
int targetSize = round(basicFontSize * scaleFactor);
fonts[0].loadFontOnce();
@@ -869,10 +870,10 @@ GLFont::Drawer::Drawer(int basicFontSize, double scaleFactor) {
} //end for
//
double rawSize = fonts[renderingFontIndex].pixHeight;
int rawSize = fonts[renderingFontIndex].pixHeight;
//targetSize may not be reached yet, so the effective rendering font: fonts[renderingFontIndex] must be scaled up a bit.
renderingFontScaleFactor = targetSize / rawSize;
renderingFontScaleFactor = (double) targetSize / rawSize;
}
void GLFont::Drawer::drawString(const std::wstring& str, float xpos, float ypos, Align hAlign, Align vAlign, int vpx, int vpy, bool cacheable) {