Be more lenient with shapes that have a different number of control points
@@ -57,11 +57,15 @@ public class ShapeData {
shapeData1.getCurves().size() + "\tShape 2: " + shapeData2.getCurves().size());
}
- if (curves.isEmpty()) {
int points = Math.min(shapeData1.getCurves().size(), shapeData2.getCurves().size());
- for (int i = 0; i < points; i++) {
+ if (curves.size() < points) {
+ for (int i = curves.size(); i < points; i++) {
curves.add(new CubicCurveData());
}
+ } else if (curves.size() > points) {
+ for (int i = points; i < curves.size(); i++) {
+ curves.remove(curves.size() - 1);
+ }
}
PointF initialPoint1 = shapeData1.getInitialPoint();
