aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt
index 817defc5f..db6ca3c30 100644
--- a/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt
+++ b/src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.kt
@@ -28,8 +28,6 @@ import at.hannibal2.skyhanni.mixins.transformers.gui.AccessorGuiContainer
import at.hannibal2.skyhanni.utils.GuiRenderUtils
import at.hannibal2.skyhanni.utils.KeyboardManager
import at.hannibal2.skyhanni.utils.LorenzUtils.round
-import at.hannibal2.skyhanni.utils.compat.GuiScreenUtils
-import at.hannibal2.skyhanni.utils.compat.SkyhanniBaseScreen
import net.minecraft.client.Minecraft
import net.minecraft.client.gui.GuiScreen
import net.minecraft.client.gui.ScaledResolution
@@ -43,7 +41,7 @@ class GuiPositionEditor(
private val positions: List<Position>,
private val border: Int,
private val oldScreen: GuiContainer? = null,
-) : SkyhanniBaseScreen() {
+) : GuiScreen() {
private var grabbedX = 0
private var grabbedY = 0
@@ -149,15 +147,15 @@ class GuiPositionEditor(
return hoveredPos
}
- private fun getScaledHeight() = GuiScreenUtils.scaledWindowHeight
- private fun getScaledWidth() = GuiScreenUtils.scaledWindowHeight
+ private fun getScaledHeight() = ScaledResolution(Minecraft.getMinecraft()).scaledHeight
+ private fun getScaledWidth() = ScaledResolution(Minecraft.getMinecraft()).scaledWidth
@Throws(IOException::class)
override fun mouseClicked(originalX: Int, priginalY: Int, mouseButton: Int) {
super.mouseClicked(originalX, priginalY, mouseButton)
- val mouseX = GuiScreenUtils.mouseX
- val mouseY = GuiScreenUtils.mouseY
+ val mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth
+ val mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1
for (i in positions.indices.reversed()) {
val position = positions[i]
val elementWidth = position.getDummySize().x