Round absolute values to not render at half a pixel

This commit is contained in:
DBotThePony 2022-09-09 14:29:54 +07:00
parent f80b913d61
commit fc096c28aa
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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<out S : Screen> @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()