Skip to content

Commit

Permalink
fix datawrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
zenith391 committed Dec 30, 2022
1 parent 3f1623f commit 3f8269f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/data.zig
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ pub fn DataWrapper(comptime T: type) type {
/// Returns true if there is currently an animation playing.
pub fn hasAnimation(self: *Self) bool {
if (!IsAnimable) return false;
self.update();
return self.value == .Animated;
return self.update();
}

pub fn animate(self: *Self, anim: *const fn (f64) f64, target: T, duration: u64) void {
Expand Down Expand Up @@ -638,6 +637,7 @@ test "data wrappers" {
var testData = DataWrapper(i32).of(0);
testData.set(5);
try expectEqual(@as(i32, 5), testData.get());
try std.testing.expect(testData.hasAnimation() == false);
}

test "data wrapper change listeners" {
Expand Down

0 comments on commit 3f8269f

Please sign in to comment.