diff --git a/crates/engine/src/cmd/graph/tests.rs b/crates/engine/src/cmd/graph/tests.rs index b4e7216808..3bca175e12 100644 --- a/crates/engine/src/cmd/graph/tests.rs +++ b/crates/engine/src/cmd/graph/tests.rs @@ -493,6 +493,16 @@ fn paint_commands_leave_a_graph_designs_art_out() { refused_on_design_art(&mut s, "paint.freeform.addPoint", json!({"ids": [art.0], "at": [0, 0]})); } +/// `attributes.info` reads the overprint of a graph design's art in a series, which the overprint edits leave out. +#[test] +fn attributes_info_reads_a_graph_designs_art() { + let (mut s, _, _, art, _) = design_art(); + let info = s.execute("attributes.info", &json!({"ids": [art.0]})).unwrap(); + assert_eq!(info["ids"], json!([art.0])); + assert_eq!(info["overprintFill"], json!(false), "{info}"); + assert_eq!(info["overprintStroke"], json!(false), "{info}"); +} + /// With only the art of a graph design selected, `stroke.setAdvanced` and the stroke mode of `paint.editGradient` act /// as edits of a selection, not of the stroke the next object drawn takes. #[test] diff --git a/crates/engine/src/cmd/overprint.rs b/crates/engine/src/cmd/overprint.rs index 781a8242ce..8149701334 100644 --- a/crates/engine/src/cmd/overprint.rs +++ b/crates/engine/src/cmd/overprint.rs @@ -133,7 +133,7 @@ fn aims(s: &Session, p: &Value, cmd: &str, kinds: impl IntoIterator .into_iter() .map(|fill| { let it = item.of_kind(s, fill); - Ok((fill, it, super::appearance::drop_design_art(&s.doc()?.doc, it.targets(s, p)?))) + Ok((fill, it, it.targets(s, p)?)) }) .collect() } @@ -156,10 +156,15 @@ pub(super) fn edit_counted(s: &mut Session, label: &str, f: impl FnOnce(&mut Doc pub(super) type OverprintJob = ((bool, ItemTarget, Vec), bool); /// The overprint edits `p` asks for under `keys` (the fill's and the stroke's), aimed as -/// `object.setOverprint` aims. +/// `object.setOverprint` aims, leaving out the art of graph designs drawn in graph series. pub(super) fn overprint_jobs(s: &Session, p: &Value, cmd: &str, keys: [&str; 2]) -> Result> { let kinds = kinds(p, cmd, keys)?; - Ok(aims(s, p, cmd, kinds.iter().map(|k| k.0))?.into_iter().zip(kinds.iter().map(|k| k.1)).collect()) + let d = &s.doc()?.doc; + Ok(aims(s, p, cmd, kinds.iter().map(|k| k.0))? + .into_iter() + .map(|(fill, it, ids)| (fill, it, super::appearance::drop_design_art(d, ids))) + .zip(kinds.iter().map(|k| k.1)) + .collect()) } /// Apply `jobs` to `d`, adding the objects changed to `changed`.