From 80059922c56843c4d9bfbb206960fc94af4d34f6 Mon Sep 17 00:00:00 2001 From: Hakan Seven Date: Thu, 11 Jun 2026 01:17:47 +0300 Subject: [PATCH] fix(mirror): negate polyline bulges in the MIRROR command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MIRROR command's LwPolyline / Polyline2D closures reflected the vertices but left the bulges untouched, so every curved segment of a mirrored polyline bowed to the wrong side. A reflection reverses the side a bulge arc bows to — negate it alongside the vertex reflection (same convention acadrust applies on its reflecting-transform paths). Co-Authored-By: Claude Opus 4.8 --- src/entities/lwpolyline.rs | 3 +++ src/entities/polyline.rs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/entities/lwpolyline.rs b/src/entities/lwpolyline.rs index 714ef2356..c9cc0d386 100644 --- a/src/entities/lwpolyline.rs +++ b/src/entities/lwpolyline.rs @@ -421,6 +421,9 @@ fn apply_transform(pline: &mut LwPolyline, t: &EntityTransform) { crate::scene::transform::apply_standard_entity_transform(pline, t, |entity, p1, p2| { for v in &mut entity.vertices { crate::scene::transform::reflect_xy_point(&mut v.location.x, &mut v.location.y, p1, p2); + // Bulge encodes which side the arc bows to; a reflection + // reverses it or every curved segment flips to the wrong side. + v.bulge = -v.bulge; } }); } diff --git a/src/entities/polyline.rs b/src/entities/polyline.rs index ea222386d..4115ca6f3 100644 --- a/src/entities/polyline.rs +++ b/src/entities/polyline.rs @@ -475,6 +475,9 @@ impl Transformable for Polyline2D { p1, p2, ); + // Bulge encodes which side the arc bows to; a reflection + // reverses it or every curved segment flips to the wrong side. + v.bulge = -v.bulge; } }); }