Skip to content

Commit

Permalink
Fix scaling?
Browse files Browse the repository at this point in the history
  • Loading branch information
ThatMG393 committed Mar 2, 2024
1 parent fbb64ba commit 706a153
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/main/java/com/thatmg393/usefulhuds/mixin/InGameHudMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,22 @@ public void render(DrawContext context, float tickDelta, CallbackInfo info) {
}

if (config.COORDS.visible) {
String text = "X: " + client.player.getX()
+ "Y: " + client.player.getY()
+ "Z: " + client.player.getZ();
String text = "X: " + (int) client.player.getX()
+ "\nY: " + (int) client.player.getY()
+ "\nZ: " + (int) client.player.getZ();

int boxPosX = config.COORDS.offsetX; // - client.textRenderer.getWidth(text) + (config.COORDS.paddingX / 2);
int boxPosY = config.COORDS.offsetY; // - config.COORDS.scale;
int[] boxPos = DrawUtils.getProperOffsets(client, config.COORDS.offsetX, config.COORDS.offsetY, text);

int textPosX = boxPosX + config.COORDS.paddingX; // - client.textRenderer.getWidth(text);
int textPosY = boxPosY + config.COORDS.paddingY; // - client.textRenderer.fontHeight;
int boxScaleX = config.COORDS.paddingX + client.textRenderer.getWidth(text);
int boxScaleY = config.COORDS.paddingY + client.textRenderer.fontHeight;

int textPosX = boxPos[0] + config.COORDS.paddingX; // - client.textRenderer.getWidth(text);
int textPosY = boxPos[1] + config.COORDS.paddingY; // - client.textRenderer.fontHeight;

DrawUtils.drawBox(
context,
boxPosX, boxPosY,
config.COORDS.scale, config.COORDS.scale,
boxPos[0], boxPos[1],
boxScaleX, boxScaleY,
0xFFFFFF
);

Expand Down

0 comments on commit 706a153

Please sign in to comment.