diff --git a/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt b/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt index f2a9e0f..4d32b77 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/ClickGui.kt @@ -18,7 +18,7 @@ object ClickGui: SnowyScreen() { override fun mouseDragged(d: Double, e: Double, i: Int, f: Double, g: Double): Boolean { if (i == 0) { components.forEach { - if (it.isWithinBounds(d, e) and !GuiDragging) { + if (it.isWithinBounds(d, e) && !GuiDragging) { GuiDragging = true it.x = d.minus(f) + (d - (it.x + it.width)) it.y = e.minus(g) + (e - (it.y + it.height)) diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt index 23188f9..b1b8d38 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/feature/ButtonImpl.kt @@ -68,7 +68,7 @@ sealed class ButtonImpl: ColoredElement(0.0, 0.0, 73, 8, opacity = 0.60F) { private var wasWithinBounds: Boolean = false var toggled: Boolean = false; private set(value) { if (value) lightUp() else if (field) lightDown() - if ((!(!field && !value))) { + if (field xor value) { field = value execAction() } else field = value