From 914e1687714f88ae98a81fa44bb53471d7c99ee0 Mon Sep 17 00:00:00 2001 From: Sarah Gerweck Date: Sun, 9 Aug 2015 22:32:59 -0700 Subject: [PATCH] Fix a bug in the `ap` function This could prevent it from updating values if you returned to the original value. E.g., if your values went 1, 2, 1, 2, you'd get notifications for 1, 2, 2. This would also cause some extra notifications to go when the logical value didn't actually change. --- src/main/scala/org/gerweck/scalafx/util/observable.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/org/gerweck/scalafx/util/observable.scala b/src/main/scala/org/gerweck/scalafx/util/observable.scala index a84156a..fc36bca 100644 --- a/src/main/scala/org/gerweck/scalafx/util/observable.scala +++ b/src/main/scala/org/gerweck/scalafx/util/observable.scala @@ -42,6 +42,7 @@ trait ObservableImplicits { val newVal = recalculate() if (prevValue != newVal) { prop.value = newVal + prevValue = newVal } }