Select: Link Block Series ignores selected type that Select All cannot reach

Type selected by id on a hidden, locked or template layer, or outside
the isolated group, no longer counts as selected type: the command stays
off and does not select that frame's thread. The check reads the
object's ancestry, so the Select menu does not walk the whole document.
This commit is contained in:
dotCooCoo
2026-11-02 15:21:51 +07:00
committed by bflatastic
parent 012a50815f
commit 405cc83cae
4 changed files with 49 additions and 8 deletions
+16
View File
@@ -1993,6 +1993,22 @@ fn select_same_link_block_series_selects_the_frames_of_a_thread() {
assert!(s.execute("select.same.linkBlockSeries", &json!({})).is_err(), "{props}");
assert_eq!(selected(&s), vec![g], "{props}");
}
s.execute("layer.setProps", &json!({"id": d.0, "locked": false})).unwrap();
// A frame on a hidden layer, selected by id, is not type to start from.
let l1 = s.doc().unwrap().doc.layers[0].id;
s.execute("layer.setProps", &json!({"id": l1.0, "visible": false})).unwrap();
sel(&mut s, &[a]);
assert!(!find_command("select.same.linkBlockSeries").unwrap().info(&s).enabled);
assert!(s.execute("select.same.linkBlockSeries", &json!({})).is_err());
s.execute("layer.setProps", &json!({"id": l1.0, "visible": true})).unwrap();
// In an isolated group, only the frames inside it count and are selected.
s.execute("object.isolate", &json!({"id": g.0})).unwrap();
sel(&mut s, &[d]);
assert_eq!(s.execute("select.same.linkBlockSeries", &json!({})).unwrap()["count"], 1);
assert_eq!(selected(&s), vec![d]);
sel(&mut s, &[a]);
assert!(!find_command("select.same.linkBlockSeries").unwrap().info(&s).enabled);
assert!(s.execute("select.same.linkBlockSeries", &json!({})).is_err());
}
/// #1737: Select > Same reads type's fill and stroke from its characters (the first run), so type