Fix #7003: Freetype fonts were scaled by both GUI and Font zoom levels. (#7267)

This commit is contained in:
PeterN
2019-02-23 16:07:25 +00:00
committed by GitHub
parent 13962a8475
commit eeae4512ae
2 changed files with 26 additions and 8 deletions

View File

@@ -84,4 +84,24 @@ static inline int ScaleGUITrad(int value)
return UnScaleGUI(value * ZOOM_LVL_BASE);
}
/**
* Short-hand to apply font zoom level.
* @param value Pixel amount at #ZOOM_LVL_BEGIN (full zoom in).
* @return Pixel amount at #ZOOM_LVL_FONT (current interface size).
*/
static inline int UnScaleFont(int value)
{
return UnScaleByZoom(value, ZOOM_LVL_FONT);
}
/**
* Scale traditional pixel dimensions to Font zoom level.
* @param value Pixel amount at #ZOOM_LVL_BASE (traditional "normal" interface size).
* @return Pixel amount at #ZOOM_LVL_FONT (current interface size).
*/
static inline int ScaleFontTrad(int value)
{
return UnScaleFont(value * ZOOM_LVL_BASE);
}
#endif /* ZOOM_FUNC_H */