Lock Guides: a marquee skips guides in groups, a group's transform leaves them

While guides were locked, a guide path inside a group was still touched by
a selection marquee, so the marquee selected the group and moving the
group moved the guide (#8538). Clicks already skip guides (#3074).

- hit: marquee_in_view and enclosure_candidates take skip_guides; the
  Selection, Direct Selection, Group Selection and Enclosing Lasso tools
  pass !cx.guides, and the marquee then touches no guide path at any depth.
- doc: Scaling::keep_guides leaves the guide paths among a group's,
  layer's or Intertwine group's children in place, as a ruler guide in a
  transformed layer already stays.
- engine: transforms (apply_transform), Transform Each and Align and
  Distribute set it while Lock Guides is on; a copy takes a copy of the
  guide with the copied art and leaves the original.

Fixes #8538
This commit is contained in:
HassanKhan
2026-11-18 15:24:42 +05:00
parent 72190d6998
commit c6a419a097
19 changed files with 235 additions and 33 deletions
+4
View File
@@ -375,6 +375,10 @@ pub struct Scaling {
/// a point (no area left), as a Transform effect leaves them, instead of being fixed to their
/// fit and flattened to one color with the object.
pub keep_fit_when_flat: bool,
/// The paths made into guides inside a transformed group, layer or Intertwine group stay
/// where they are, as a ruler guide in a transformed layer does: View › Guides › Lock Guides
/// is on (#8538). A guide transformed by itself still moves.
pub keep_guides: bool,
}
impl Scaling {
+7 -4
View File
@@ -527,10 +527,13 @@ impl Node {
}
}
}
NodeKind::Layer { children, .. }
| NodeKind::Group { children, .. }
| NodeKind::Compound { children, .. }
| NodeKind::Intertwine { children } => {
NodeKind::Layer { children, .. } | NodeKind::Group { children, .. } | NodeKind::Intertwine { children } => {
// Locked guides stay where they are ([`Scaling::keep_guides`]).
for c in children.iter_mut().filter(|c| !(sc.keep_guides && matches!(c.kind, NodeKind::Path { guide: true, .. }))) {
Arc::make_mut(c).transform_scaled(a, sc);
}
}
NodeKind::Compound { children, .. } => {
for c in children.iter_mut() {
Arc::make_mut(c).transform_scaled(a, sc);
}
+9 -2
View File
@@ -227,8 +227,15 @@ fn assert_round_corners(n: &Node, back: Affine, r: f64) {
}
}
const KEEP_CORNERS: Scaling =
Scaling { strokes: false, effects: None, keep_type_strokes: false, keep_corners: true, patterns: false, keep_fit_when_flat: false };
const KEEP_CORNERS: Scaling = Scaling {
strokes: false,
effects: None,
keep_type_strokes: false,
keep_corners: true,
patterns: false,
keep_fit_when_flat: false,
keep_guides: false,
};
#[test]
fn uneven_scales_keep_live_corners_circular() {