mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 10:35:11 -04:00
Fix DPI scaling of buttons mostly
This commit is contained in:
parent
7b3feb90df
commit
f2afaf36d7
@ -142,7 +142,7 @@ static void ButtonWidget_Render(void* widget, double delta) {
|
|||||||
Texture_Render(&back);
|
Texture_Render(&back);
|
||||||
} else {
|
} else {
|
||||||
/* Split button down the middle */
|
/* Split button down the middle */
|
||||||
scale = (w->width / 400.0f) * 0.5f;
|
scale = (w->width / 400.0f) / (2 * DisplayInfo.ScaleX);
|
||||||
Gfx_BindTexture(back.ID); /* avoid bind twice */
|
Gfx_BindTexture(back.ID); /* avoid bind twice */
|
||||||
|
|
||||||
back.Width = (w->width / 2);
|
back.Width = (w->width / 2);
|
||||||
@ -181,7 +181,7 @@ static void ButtonWidget_BuildMesh(void* widget, struct VertexTextured** vertice
|
|||||||
*vertices += 4; /* always use up 8 vertices for body */
|
*vertices += 4; /* always use up 8 vertices for body */
|
||||||
} else {
|
} else {
|
||||||
/* Split button down the middle */
|
/* Split button down the middle */
|
||||||
scale = (w->width / 400.0f) * 0.5f;
|
scale = (w->width / 400.0f) / (2 * DisplayInfo.ScaleX);
|
||||||
|
|
||||||
back.Width = (w->width / 2);
|
back.Width = (w->width / 2);
|
||||||
back.uv.U1 = 0.0f; back.uv.U2 = BUTTON_uWIDTH * scale;
|
back.uv.U1 = 0.0f; back.uv.U2 = BUTTON_uWIDTH * scale;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user