fmt: order the deselect_path use and wrap the segment-ends closure

This commit is contained in:
dotCooCoo committed 2026-11-30 14:55:04 -08:00
1 parent d87db42a12
commit 9fdf53ce0f
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -881,11 +881,11 @@ pub use docinfo::{CATEGORIES, OBJECT_LABELS, byte_size, ppi_number};
pub use docmenu::guide_indexes;
pub(crate) use edit::{Unrecorded, artboard_tool_picks, settle_interaction, typing_in_progress};
pub(crate) use object::bounds_rewrite;
pub(crate) use path::deselect_path;
pub(crate) use object::{keep_aligned_in, refresh_pixel_aligned};
/// The rules `object.scale`, `object.reflect` and `object.shear` check their params with.
pub use object::{reflect_axis, scale_factors, shear_tangent};
pub(crate) use paint::{asks_defaults_only, painting_tool_of};
pub(crate) use path::deselect_path;
pub use plugin_call::{Location, ParamsPlace, key_location, location_in, location_keys};
pub use select::SIMILAR;
pub(crate) use vectorcraft_doc::range::parse_range;
+2 -1
View File
@@ -947,7 +947,8 @@ fn on_doc_steps<T>(
&& !before.segments.get(&id).is_some_and(|g| g.iter().any(segment_left));
if reopened && reshaped != Some(id) {
// Segment k of a subpath of n anchors ends at anchors k and (k + 1) mod n.
let len = |p: usize| old.node(id).and_then(|n| n.path_data()).and_then(|pd| pd.subpaths.get(p)).map_or(1, |sp| sp.anchors.len().max(1));
let len =
|p: usize| old.node(id).and_then(|n| n.path_data()).and_then(|pd| pd.subpaths.get(p)).map_or(1, |sp| sp.anchors.len().max(1));
let ends: HashSet<(usize, usize)> =
before.segments.remove(&id).into_iter().flatten().flat_map(|(p, k)| [(p, k), (p, (k + 1) % len(p))]).collect();
if let Some(kept) = before.anchors.get_mut(&id) {