Skip to content

Commit b4667aa

Browse files
committed
setting the color correctly
1 parent f4d36ae commit b4667aa

2 files changed

Lines changed: 11 additions & 6 deletions

File tree

src/main/java/eu/mihosoft/vrl/v3d/Polygon.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -742,10 +742,14 @@ public ArrayList<Edge> edges() {
742742
}
743743

744744
public Polygon setColor(Color color) {
745-
r=color.getRed();
746-
g=color.getGreen();
747-
b=color.getBlue();
748-
o=color.getOpacity();
745+
if(color!=null) {
746+
r=color.getRed();
747+
g=color.getGreen();
748+
b=color.getBlue();
749+
o=color.getOpacity();
750+
}else {
751+
setColor(CSG.getDefaultColor());
752+
}
749753
return this;
750754
}
751755
public Color getColor() {

src/main/java/eu/mihosoft/vrl/v3d/svg/SVGLoad.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,10 @@ private void loadSingle(String code, double resolution, Transform startingFrame,
649649

650650
poly = Polygon.fromPoints(Extrude.toCCW(poly.getPoints()));
651651
poly.setHole(hole);
652-
if (c != null)
652+
if (c != null) {
653653
colors.put(poly, c);
654-
poly.setColor(c);
654+
poly.setColor(c);
655+
}
655656
list.add(poly);
656657

657658
}

0 commit comments

Comments
 (0)