From 5c9cbdba458638ae962ccf92e750ebdcea718478 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Wed, 22 Nov 2023 12:10:51 +0000 Subject: Internal Change: More Random Cleanup (#724) More Random Cleanup #724 --- src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt') diff --git a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt index 7e10b0351..869aeeb25 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt @@ -244,7 +244,7 @@ object RenderUtils { /** * @author Mojang */ - fun drawNametag(str: String, color: Color?) { + private fun drawNametag(str: String, color: Color?) { val fontRenderer = Minecraft.getMinecraft().fontRendererObj val f1 = 0.02666667f GlStateManager.pushMatrix() @@ -352,7 +352,7 @@ object RenderUtils { return lastValue + (currentValue - lastValue) * multiplier } - fun Position.transform(): Pair { + private fun Position.transform(): Pair { GlStateManager.translate(getAbsX().toFloat(), getAbsY().toFloat(), 0F) GlStateManager.scale(effectiveScale, effectiveScale, 1F) val x = ((Utils.getMouseX() - getAbsX()) / effectiveScale).toInt() @@ -374,14 +374,11 @@ object RenderUtils { val minecraft = Minecraft.getMinecraft() val renderer = minecraft.renderManager.fontRenderer - val x = offsetX - val y = offsetY - - GlStateManager.translate(x + 1.0, y + 1.0, 0.0) + GlStateManager.translate(offsetX + 1.0, offsetY + 1.0, 0.0) if (centered) { val strLen: Int = renderer.getStringWidth(string) - val x2 = x - strLen / 2f + val x2 = offsetX - strLen / 2f GL11.glTranslatef(x2, 0f, 0f) renderer.drawStringWithShadow(display, 0f, 0f, 0) GL11.glTranslatef(-x2, 0f, 0f) -- cgit