diff --git a/src/main/scala/org/gerweck/scalafx/util/observable.scala b/src/main/scala/org/gerweck/scalafx/util/observable.scala index 7078ddb..8d17311 100644 --- a/src/main/scala/org/gerweck/scalafx/util/observable.scala +++ b/src/main/scala/org/gerweck/scalafx/util/observable.scala @@ -17,8 +17,13 @@ trait ObservableImplicits { val prop = ObjectProperty[B](originalValue) + var prevValue = originalValue def changeHandler = { - prop.value = recalculate() + val newVal = recalculate() + if (prevValue != newVal) { + prop.value = recalculate() + prevValue = newVal + } } a onChange changeHandler