Skip to content

Commit 18ac32c

Browse files
committed
small fixes
1 parent 869c6dc commit 18ac32c

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/main/java/clipper2/Clipper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ public static PathD RamerDouglasPeucker(PathD path, double epsilon) {
10821082
if (len < 5) {
10831083
return path;
10841084
}
1085-
List<Boolean> flags = new ArrayList<>(Arrays.asList(new Boolean[len]));
1085+
List<Boolean> flags = new ArrayList<>(Collections.nCopies(len, false));
10861086
flags.set(0, true);
10871087
flags.set(len - 1, true);
10881088
RDP(path, 0, len - 1, Sqr(epsilon), flags);
@@ -1482,7 +1482,7 @@ public static Path64 Ellipse(Point64 center, double radiusX, double radiusY, int
14821482
double co = Math.cos(2 * Math.PI / steps);
14831483
double dx = co, dy = si;
14841484
Path64 result = new Path64(steps);
1485-
result.add(new Point64(center.x + radiusX, center.x));
1485+
result.add(new Point64(center.x + radiusX, center.y));
14861486
for (int i = 1; i < steps; ++i) {
14871487
result.add(new Point64(center.x + radiusX * dx, center.y + radiusY * dy));
14881488
double x = dx * co - dy * si;

src/main/java/clipper2/engine/Clipper64.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public final boolean Execute(ClipType clipType, FillRule fillRule, PolyTree64 po
9898

9999
@Override
100100
public void AddReuseableData(ReuseableDataContainer64 reuseableData) {
101-
this.AddReuseableData(reuseableData);
101+
super.AddReuseableData(reuseableData);
102102
}
103103

104104
}

src/main/java/clipper2/offset/ClipperOffset.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,9 @@ private void OffsetOpenPath(Group group, Path64 path) {
579579
pathOut = new Path64();
580580
int highI = path.size() - 1;
581581
if (highI < 1) { // A path with 0 or 1 points can't be offset this way.
582-
if (highI == 0)
582+
if (highI == 0) {
583583
solution.add(new Path64(path));
584+
}
584585
return;
585586
}
586587

0 commit comments

Comments
 (0)