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;
|
this.property = property;
|
||||||
fields = new HashMap<>();
|
fields = new HashMap<>();
|
||||||
fields.put("add", new FunctionValue(add()));
|
fields.put("add", new FunctionValue(add()));
|
||||||
|
fields.put("clear", new FunctionValue(clear()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -102,6 +103,13 @@ public class PropertyValue implements Value {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Function clear() {
|
||||||
|
return args -> {
|
||||||
|
property.getProperty().get().clear();
|
||||||
|
return this;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object raw() {
|
public Object raw() {
|
||||||
return property;
|
return property;
|
||||||
|
@ -26,4 +26,9 @@ public class PropertyTimeline<T> {
|
|||||||
keyFrames.put(keyFrame, new KeyFrameValue<>(value, interpolator));
|
keyFrames.put(keyFrame, new KeyFrameValue<>(value, interpolator));
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PropertyTimeline<T> clear() {
|
||||||
|
keyFrames.clear();
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user