diff --git a/src/main/java/clipper2/Clipper.java b/src/main/java/clipper2/Clipper.java index 45302ca..6e9982b 100644 --- a/src/main/java/clipper2/Clipper.java +++ b/src/main/java/clipper2/Clipper.java @@ -677,7 +677,7 @@ public static PathsD ReversePaths(PathsD paths) { } public static Rect64 GetBounds(Path64 path) { - Rect64 result = InvalidRect64; + Rect64 result = InvalidRect64.clone(); for (Point64 pt : path) { if (pt.x < result.left) { result.left = pt.x; @@ -696,7 +696,7 @@ public static Rect64 GetBounds(Path64 path) { } public static Rect64 GetBounds(Paths64 paths) { - Rect64 result = InvalidRect64; + Rect64 result = InvalidRect64.clone(); for (Path64 path : paths) { for (Point64 pt : path) { if (pt.x < result.left) { @@ -717,7 +717,7 @@ public static Rect64 GetBounds(Paths64 paths) { } public static RectD GetBounds(PathD path) { - RectD result = InvalidRectD; + RectD result = InvalidRectD.clone(); for (PointD pt : path) { if (pt.x < result.left) { result.left = pt.x; @@ -736,7 +736,7 @@ public static RectD GetBounds(PathD path) { } public static RectD GetBounds(PathsD paths) { - RectD result = InvalidRectD; + RectD result = InvalidRectD.clone(); for (PathD path : paths) { for (PointD pt : path) { if (pt.x < result.left) { diff --git a/src/main/java/clipper2/engine/ClipperBase.java b/src/main/java/clipper2/engine/ClipperBase.java index d57e33f..626d28e 100644 --- a/src/main/java/clipper2/engine/ClipperBase.java +++ b/src/main/java/clipper2/engine/ClipperBase.java @@ -2778,7 +2778,7 @@ public static Rect64 GetBounds(Path64 path) { if (path.isEmpty()) { return new Rect64(); } - Rect64 result = Clipper.InvalidRect64; + Rect64 result = Clipper.InvalidRect64.clone(); for (Point64 pt : path) { if (pt.x < result.left) { result.left = pt.x; @@ -2893,7 +2893,7 @@ protected void BuildTree(PolyPathBase polytree, Paths64 solutionOpen) { } public final Rect64 GetBounds() { - Rect64 bounds = Clipper.InvalidRect64; + Rect64 bounds = Clipper.InvalidRect64.clone(); for (Vertex t : vertexList) { Vertex v = t; do {