forked from 1b-agent/opencadstudio-upstream
fix: closing-segment markers on closed polylines; case-insensitive page-setup names
- resolve_point, set_polyline_vertex and the solver's point_for_marker treat the marker one past the last vertex of a closed polyline as vertex 0, the way line_segment already did. Equal (#1366), the axis pre-alignment (#1365) and the transform pin (#1361) address a picked segment's end that way, so on the closing segment they either refused the pick or pinned nothing. - Page-setup dictionary keys compare case-insensitively: page_setup_save replaces "site" when "Site" exists instead of adding a second entry (PSETUPIN counted it as replaced, #1344), delete and rename match the same way, and a rename that only changes case is allowed. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
75e7f825cd
commit
a1629fd073
3 files changed
+63
-11
No files matched your search
@@ -87,8 +87,16 @@ impl EntityGeom {
|
||||
(EntityGeom::Line(l), 0) => Some(l.p1),
|
||||
(EntityGeom::Line(l), 1) => Some(l.p2),
|
||||
(EntityGeom::Ray(l), 0) => Some(l.p1),
|
||||
(EntityGeom::Polyline { points, .. }, marker) if marker >= 0 => {
|
||||
points.get(marker as usize).copied()
|
||||
(EntityGeom::Polyline { points, closed, .. }, marker) if marker >= 0 => {
|
||||
// The closing segment's end marker (one past the last vertex)
|
||||
// is vertex 0 on a closed polyline, as in `line_segment`.
|
||||
let index = marker as usize;
|
||||
let index = if *closed && index == points.len() && !points.is_empty() {
|
||||
0
|
||||
} else {
|
||||
index
|
||||
};
|
||||
points.get(index).copied()
|
||||
}
|
||||
(EntityGeom::Circle(c), -3) => Some(c.center),
|
||||
(EntityGeom::Arc(a), 0) => Some(a.start),
|
||||
|
||||
Reference in new issue
Block a user