From ee163fe312b3472d7a369ecaeb5e480920294016 Mon Sep 17 00:00:00 2001 From: Username404-59 Date: Sat, 1 May 2021 19:31:15 +0200 Subject: [PATCH] Fix the logic of toggleable buttons --- .../kotlin/fr/username404/snowygui/gui/elements/ClickButton.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickButton.kt b/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickButton.kt index f45713c..960c0ed 100644 --- a/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickButton.kt +++ b/common/src/main/kotlin/fr/username404/snowygui/gui/elements/ClickButton.kt @@ -41,8 +41,8 @@ class ClickButton( if (it) { if (!toggled) lightUp() else lightDown() if ((kind == Type.TOGGLE)) { - if (toggled) execAction() toggled = !toggled + if (toggled) execAction() } } }