MidnightControls 1.4.1 - Fix tooltips getting displaced

Fixes tooltips in inventories getting displaced when having the GUI scale set to something above 4.
This commit is contained in:
Motschen
2022-07-06 14:14:25 +02:00
parent 735b9e8718
commit 9891cd2977
3 changed files with 5 additions and 3 deletions

View File

@@ -62,6 +62,7 @@ public abstract class HandledScreenMixin implements HandledScreenAccessor {
if (client.options.getGuiScale().getValue() >= 4) {
scale = 0.75f;
} else scale = 1f;
matrices.push();
if (scale != 1f) matrices.scale(scale,scale,scale);
int x = 2, y = (int) (client.getWindow().getScaledHeight() * (1 / scale) - 2 - MidnightControlsRenderer.ICON_SIZE);
if (MidnightControlsCompat.isEMIPresent()) {
@@ -80,7 +81,7 @@ public abstract class HandledScreenMixin implements HandledScreenAccessor {
}
x = MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_X}, "midnightcontrols.action.pickup", true, client);
MidnightControlsRenderer.drawButtonTip(matrices, x, y, new int[]{GLFW.GLFW_GAMEPAD_BUTTON_Y}, "midnightcontrols.action.quick_move", true, client);
if (scale != 1f) matrices.scale(1,1,1);
matrices.pop();
}
}
}