From 86febca150086e28aa2173faa243ab2f052353db Mon Sep 17 00:00:00 2001 From: Matthieu Viry Date: Wed, 14 May 2025 16:26:10 +0200 Subject: [PATCH] Bump i_overlay dependency to 3.4.1 This changes the winding order of polygon rings to match the one in use in geo. --- geo/Cargo.toml | 2 +- geo/src/algorithm/bool_ops/i_overlay_integration.rs | 3 --- geo/src/algorithm/bool_ops/mod.rs | 4 ++-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/geo/Cargo.toml b/geo/Cargo.toml index 40b2862e1..99db7931a 100644 --- a/geo/Cargo.toml +++ b/geo/Cargo.toml @@ -31,7 +31,7 @@ proj = { version = "0.30.0", optional = true } robust = "1.1.0" rstar = "0.12.0" serde = { version = "1.0", optional = true, features = ["derive"] } -i_overlay = { version = "2.0.0, < 2.1.0", default-features = false } +i_overlay = { version = "3.4.1", default-features = false } [dev-dependencies] approx = ">= 0.4.0, < 0.6.0" diff --git a/geo/src/algorithm/bool_ops/i_overlay_integration.rs b/geo/src/algorithm/bool_ops/i_overlay_integration.rs index 1d86cf431..8ce42fc92 100644 --- a/geo/src/algorithm/bool_ops/i_overlay_integration.rs +++ b/geo/src/algorithm/bool_ops/i_overlay_integration.rs @@ -47,11 +47,8 @@ pub(super) mod convert { pub fn polygon_from_shape(shape: Vec>>) -> Polygon { let mut rings = shape.into_iter().map(|path| { - // From i_overlay: > Note: Outer boundary paths have a clockwise order, and holes have a counterclockwise order. - // Which is the opposite convention we use. let mut line_string = line_string_from_path(path); line_string.close(); - line_string.0.reverse(); line_string }); let exterior = rings.next().unwrap_or(LineString::new(vec![])); diff --git a/geo/src/algorithm/bool_ops/mod.rs b/geo/src/algorithm/bool_ops/mod.rs index db74ed17d..303d5dd71 100644 --- a/geo/src/algorithm/bool_ops/mod.rs +++ b/geo/src/algorithm/bool_ops/mod.rs @@ -184,9 +184,9 @@ pub fn unary_union<'a, B: BooleanOps + 'a>( .collect::>(); let fill_rule = if winding_order == Some(WindingOrder::Clockwise) { - FillRule::Positive - } else { FillRule::Negative + } else { + FillRule::Positive }; let shapes = FloatOverlay::with_subj(&subject).overlay(OverlayRule::Subject, fill_rule);