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