From 396f859d6a65c95ece766052ebb9e8f31ab4fec7 Mon Sep 17 00:00:00 2001 From: Edwin Jakobs Date: Sun, 2 Feb 2020 11:12:44 +0100 Subject: [PATCH] Fix for IntParameters in orx-gui --- orx-gui/src/main/kotlin/Gui.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orx-gui/src/main/kotlin/Gui.kt b/orx-gui/src/main/kotlin/Gui.kt index 8e02b811..5a35fa85 100644 --- a/orx-gui/src/main/kotlin/Gui.kt +++ b/orx-gui/src/main/kotlin/Gui.kt @@ -82,7 +82,7 @@ class GUI : Extension { slider { label = parameter.label range = Range(parameter.intRange!!.start.toDouble(), parameter.intRange!!.endInclusive.toDouble()) - precision = parameter.precision!! + precision = 0 value = (parameter.property as KMutableProperty1).get(obj).toDouble() events.valueChanged.subscribe { (parameter.property as KMutableProperty1).set(obj, value.toInt()) @@ -107,7 +107,7 @@ class GUI : Extension { button { label = parameter.label events.clicked.subscribe { - parameter.property.call() + parameter.property.call(obj) onChangeListener?.invoke(parameter.property.name, null) } }