diff options
author | Walker Selby <git@walkerselby.com> | 2023-11-22 12:10:51 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-22 13:10:51 +0100 |
commit | 5c9cbdba458638ae962ccf92e750ebdcea718478 (patch) | |
tree | f4ab8c3f6abe71d4e056125f582cfde465fd79d0 /src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | |
parent | 7137b0a07ba4c4efe65282a18ebc68f25ffa1796 (diff) | |
download | skyhanni-5c9cbdba458638ae962ccf92e750ebdcea718478.tar.gz skyhanni-5c9cbdba458638ae962ccf92e750ebdcea718478.tar.bz2 skyhanni-5c9cbdba458638ae962ccf92e750ebdcea718478.zip |
Internal Change: More Random Cleanup (#724)
More Random Cleanup #724
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt | 11 |
1 files changed, 4 insertions, 7 deletions
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<Int, Int> { + private fun Position.transform(): Pair<Int, Int> { 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) |