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

Add fill rule svg property

This commit is contained in:
Victor 2017-09-08 13:26:05 +03:00
parent 14c792ee5e
commit e1a792ac9b

View File

@ -5,6 +5,7 @@ import com.annimon.hotarufx.visual.PropertyTimeline;
import com.annimon.hotarufx.visual.PropertyTimelineHolder;
import com.annimon.hotarufx.visual.TimeLine;
import com.annimon.hotarufx.visual.visitors.NodeVisitor;
import javafx.scene.shape.FillRule;
import javafx.scene.shape.SVGPath;
import static com.annimon.hotarufx.visual.PropertyType.STRING;
@ -13,6 +14,7 @@ public class SVGPathNode extends ShapeNode {
public final SVGPath svgPath;
private PropertyTimelineHolder<String> content;
private PropertyTimelineHolder<String> fillRule;
public SVGPathNode() {
this(new SVGPath());
@ -22,22 +24,29 @@ public class SVGPathNode extends ShapeNode {
super(svgPath);
this.svgPath = svgPath;
content = PropertyTimelineHolder.empty();
fillRule = PropertyTimelineHolder.empty();
}
public PropertyTimeline<String> contentProperty() {
return content.setIfEmptyThenGet(svgPath::contentProperty);
}
public PropertyTimeline<String> fillRuleProperty() {
return fillRule.setIfEmptyThenGet(enumToString(FillRule.class, svgPath.fillRuleProperty()));
}
@Override
public void buildTimeline(TimeLine timeline) {
super.buildTimeline(timeline);
content.applyIfPresent(timeline);
fillRule.applyIfPresent(timeline);
}
@Override
public PropertyBindings propertyBindings(PropertyBindings bindings) {
return super.propertyBindings(bindings)
.add("content", STRING, this::contentProperty);
.add("content", STRING, this::contentProperty)
.add("fillRule", STRING, this::fillRuleProperty);
}
@Override