Improve movement of GUI elements in ClickGui.kt
This commit is contained in:
parent
d113c13ecc
commit
996572884e
|
@ -16,8 +16,9 @@ object ClickGui: SnowyScreen() {
|
||||||
components.forEach {
|
components.forEach {
|
||||||
if (((d >= it.x) && (d <= (it.x + it.width))) and ((e >= it.y) && (e <= (it.y + it.height))) and !GuiDragging) {
|
if (((d >= it.x) && (d <= (it.x + it.width))) and ((e >= it.y) && (e <= (it.y + it.height))) and !GuiDragging) {
|
||||||
GuiDragging = true
|
GuiDragging = true
|
||||||
it.x = d + (d - (it.x + it.width))
|
Snowy.logs.info("$d, $e")
|
||||||
it.y = e + (e - (it.y + it.height))
|
it.x = d.minus(f) + (d - (it.x + it.width))
|
||||||
|
it.y = e.minus(g) + (e - (it.y + it.height))
|
||||||
} else GuiDragging = false
|
} else GuiDragging = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue