1
0
mirror of https://github.com/aNNiMON/HotaruFX.git synced 2024-09-19 14:14:21 +03:00

Add an ability to clear property keyframes

This commit is contained in:
Victor 2017-09-16 13:22:28 +03:00
parent f1cfe7948b
commit 738e93d9ef
2 changed files with 13 additions and 0 deletions

View File

@ -24,6 +24,7 @@ public class PropertyValue implements Value {
this.property = property;
fields = new HashMap<>();
fields.put("add", new FunctionValue(add()));
fields.put("clear", new FunctionValue(clear()));
}
@Override
@ -102,6 +103,13 @@ public class PropertyValue implements Value {
};
}
private Function clear() {
return args -> {
property.getProperty().get().clear();
return this;
};
}
@Override
public Object raw() {
return property;

View File

@ -26,4 +26,9 @@ public class PropertyTimeline<T> {
keyFrames.put(keyFrame, new KeyFrameValue<>(value, interpolator));
return this;
}
public PropertyTimeline<T> clear() {
keyFrames.clear();
return this;
}
}