fix(transform): limit ancestor detachment to moving preview

This commit is contained in:
Khawar Zamman Wani committed 2026-10-27 20:10:24 +05:30
1 parent 37c21e1d77
commit d53e14bccc
2 files changed
+7 -1

No files matched your search

@@ -170,6 +170,13 @@ impl Several {
let mut d = live.clone();
show_only(&mut d.layers, ids);
for id in ids {
if let Some(path) = d.path_of(*id) {
for n in 1..path.len() {
if let Some(ancestor) = path.get(..n).and_then(|p| d.layer_at_mut(p)) {
ancestor.clipped = false;
}
}
}
if let Some(l) = d.layer_mut(*id) {
l.clipped = false;
}
@@ -214,7 +214,6 @@ pub(super) fn show_only(layers: &mut [photocraft_doc::Layer], keep: &[LayerId])
}
match &mut l.content {
LayerContent::Group(g) if g.children.iter().any(|c| keep.iter().any(|k| contains(c, *k))) => {
l.clipped = false;
// This ancestor only clips the covering children. Its background is already
// on the base canvas; drawing it again would cover the moving layer in white.
if let Some(board) = &mut g.artboard {