Improve movement of GUI elements in ClickGui.kt

This commit is contained in:
Username404-59 2021-04-28 20:22:54 +02:00
parent d113c13ecc
commit 996572884e
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 2 deletions

View File

@ -16,8 +16,9 @@ object ClickGui: SnowyScreen() {
components.forEach {
if (((d >= it.x) && (d <= (it.x + it.width))) and ((e >= it.y) && (e <= (it.y + it.height))) and !GuiDragging) {
GuiDragging = true
it.x = d + (d - (it.x + it.width))
it.y = e + (e - (it.y + it.height))
Snowy.logs.info("$d, $e")
it.x = d.minus(f) + (d - (it.x + it.width))
it.y = e.minus(g) + (e - (it.y + it.height))
} else GuiDragging = false
}
}