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:
parent
f1cfe7948b
commit
738e93d9ef
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user