Fixed rounding
diff --git a/lottie/src/main/java/com/airbnb/lottie/animation/content/RoundedCornersContent.java b/lottie/src/main/java/com/airbnb/lottie/animation/content/RoundedCornersContent.java
index 30db45c..d4453be 100644
--- a/lottie/src/main/java/com/airbnb/lottie/animation/content/RoundedCornersContent.java
+++ b/lottie/src/main/java/com/airbnb/lottie/animation/content/RoundedCornersContent.java
@@ -112,7 +112,7 @@
PointF nextVertex = startingCurve.getVertex();
// We can't round the corner of the end of a non-closed curve.
- boolean isEndOfCurve = !startingShapeData.isClosed() && (i == 0 && i == startingCurves.size() - 1);
+ boolean isEndOfCurve = !startingShapeData.isClosed() && (i == 0 || i == startingCurves.size() - 1);
if (inPoint.equals(vertex) && outPoint.equals(vertex) && !isEndOfCurve) {
// This vertex is a point. Round its corners
float dxToPreviousVertex = vertex.x - previousVertex.x;
@@ -186,7 +186,7 @@
PointF inPoint = (i == 0 && !isClosed) ? vertex : previousCurve.getControlPoint2();
PointF outPoint = startingCurve.getControlPoint1();
- boolean isEndOfCurve = !startingShapeData.isClosed() && (i == 0 && i == startingCurves.size() - 1);
+ boolean isEndOfCurve = !startingShapeData.isClosed() && (i == 0 || i == startingCurves.size() - 1);
if (inPoint.equals(vertex) && outPoint.equals(vertex) && !isEndOfCurve) {
vertices += 2;
} else {
diff --git a/snapshot-tests/src/main/assets/Tests/RoundedNonClosed.json b/snapshot-tests/src/main/assets/Tests/RoundedNonClosed.json
new file mode 100644
index 0000000..dfa149f
--- /dev/null
+++ b/snapshot-tests/src/main/assets/Tests/RoundedNonClosed.json
@@ -0,0 +1 @@
+{"v":"5.12.1","fr":60,"ip":0,"op":301,"w":850,"h":850,"nm":"Learn-icon-circle","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Path 3","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[327,475.038,0],"ix":2,"l":2},"a":{"a":0,"k":[0,0,0],"ix":1,"l":2},"s":{"a":0,"k":[-1800,1800,100],"ix":6,"l":2}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[-14.672,-13.86],[1.815,-3.469],[5.3,11.535]],"o":[[0,0],[7.167,6.77],[-5.891,11.262],[-2.639,-5.743]],"v":[[-23.844,-20.05],[12.222,-18.383],[14.169,9.792],[-21.578,9.407]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,0,0,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":2,"ix":5},"lc":2,"lj":2,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Path","np":2,"cix":2,"bm":0,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"rd","nm":"Round Corners 1","r":{"a":0,"k":358.2,"ix":1},"ix":2,"mn":"ADBE Vector Filter - RC","hd":false}],"ip":0,"op":3600,"st":0,"ct":1,"bm":0}],"markers":[],"props":{}}
\ No newline at end of file