From fc096c28aaa013d0801ed01e0a27245dbbb6acf5 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 9 Sep 2022 14:29:54 +0700 Subject: [PATCH] Round absolute values to not render at half a pixel --- .../dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt index 8b0568af3..2ac0ec5a2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt @@ -17,6 +17,7 @@ import ru.dbotthepony.mc.otm.client.screen.MatteryScreen import java.util.* import kotlin.collections.ArrayList import kotlin.math.max +import kotlin.math.roundToInt @JvmRecord data class ScreenPos(val x: Float, val y: Float) @@ -417,7 +418,7 @@ open class EditablePanel @JvmOverloads constructor( } poseStack.pushPose() - poseStack.translate(absoluteX.toDouble(), absoluteY.toDouble(), accumulatedDepth.toDouble()) + poseStack.translate(absoluteX.roundToInt().toDouble(), absoluteY.roundToInt().toDouble(), accumulatedDepth.toDouble()) innerRender(poseStack, mouseX, mouseY, partialTick) poseStack.popPose()