mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-10 07:49:57 -04:00
Quick fix for UI elements being scaled too large on desktop with high DPI (thanks FizzWhiz)
This commit is contained in:
parent
1728314b59
commit
add56ce622
12
src/Gui.c
12
src/Gui.c
@ -26,8 +26,16 @@ static cc_uint8 priorities[GUI_MAX_SCREENS];
|
||||
*----------------------------------------------------------Gui------------------------------------------------------------*
|
||||
*#########################################################################################################################*/
|
||||
static CC_NOINLINE int GetWindowScale(void) {
|
||||
float windowScale = min(WindowInfo.Width / 640.0f, WindowInfo.Height / 480.0f);
|
||||
return 1 + (int)windowScale;
|
||||
float widthScale = WindowInfo.Width / 640.0f;
|
||||
float heightScale = WindowInfo.Height / 480.0f;
|
||||
|
||||
/* Use larger UI scaling on mobile */
|
||||
/* TODO move this DPI scaling elsewhere.,. */
|
||||
if (!Input_TouchMode) {
|
||||
widthScale /= DisplayInfo.ScaleX;
|
||||
heightScale /= DisplayInfo.ScaleY;
|
||||
}
|
||||
return 1 + (int)(min(widthScale, heightScale));
|
||||
}
|
||||
|
||||
float Gui_Scale(float value) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user