diff --git a/crates/tools/src/settings.rs b/crates/tools/src/settings.rs index 635ec8e4a0..51c408261e 100644 --- a/crates/tools/src/settings.rs +++ b/crates/tools/src/settings.rs @@ -44,8 +44,9 @@ const ROWS: &[Row] = &[ "affectsDensity", ], ), - // The graphic style the Symbol Styler applies, set from the Graphic Styles panel. - (&["symbolStyler"], None, &["style"]), + // The graphic style the Symbol Styler and the Symbol Sprayer's User Defined Style apply, set + // from the Graphic Styles panel. + (&["symbolSprayer", "symbolStyler"], Some("symbolismStyle"), &["style"]), (&["mirrorCut"], None, &["axis", "keep"]), (&["puppetWarp"], None, &["showMesh", "expand"]), (&["arc"], None, &["closed", "lengthX", "lengthY", "reference", "baseAlong", "slope", "fillArc"]), diff --git a/crates/ui-egui/src/panels/graphic_styles.rs b/crates/ui-egui/src/panels/graphic_styles.rs index b03e2e0662..7c69333bc6 100644 --- a/crates/ui-egui/src/panels/graphic_styles.rs +++ b/crates/ui-egui/src/panels/graphic_styles.rs @@ -3,7 +3,8 @@ //! shows the shape outlined in black and filled with white, under a red slash. Clicking a style applies it to the //! selection (Alt-click adds it on top); Shift-click adds to the panel's selection every style from //! the last one clicked without Shift through this one; Cmd/Ctrl-click adds or removes one. The -//! style last clicked into the selection is the one the Symbol Styler applies. Double-click opens +//! style last clicked into the selection is the one the Symbol Styler and the Symbol Sprayer's User +//! Defined Style apply. Double-click opens //! Graphic Style Options. Dragging a style moves it in the list (dropped on //! another style with Alt held, replaces that style with its look), applies it //! to the art it is dropped on (`canvas::panel_drop`), or, dropped on New Graphic Style, adds a @@ -553,7 +554,8 @@ fn act(app: &mut VectorcraftApp, ui: &Ui, s: &Shown, ev: Events, picker: bool) { Some(Click::Pick(name, m)) => { let order: Vec<&str> = s.d.graphic_styles.iter().map(|g| g.name.as_str()).collect(); let sel = super::swatches::click_selection(ui, "gs-anchor", selected(ui.ctx(), s.d), &order, &name, m); - // The style clicked into the selection is the one the Symbol Styler applies. + // The style clicked into the selection is the one the Symbol Styler and the Symbol + // Sprayer's User Defined Style apply (the two share it). if sel.contains(&name) { app.run("tool.setOption", json!({"tool": "symbolStyler", "values": {"style": name}})).ok(); } @@ -1709,6 +1711,8 @@ mod tests { assert_eq!(styler(&app).as_ref(), Some(&n[3])); assert_eq!(click(&mut app, 2, egui::Modifiers::COMMAND), [n[0].clone(), n[1].clone(), n[3].clone(), n[2].clone()]); assert_eq!(styler(&app).as_ref(), Some(&n[2])); + // The Symbol Sprayer's User Defined Style applies the same style. + assert_eq!(app.session.tool_options_of("symbolSprayer")["style"].as_str(), Some(n[2].as_str())); // Shift-click extends from the style Cmd/Ctrl-clicked last. click(&mut app, 0, egui::Modifiers::NONE); click(&mut app, 2, egui::Modifiers::COMMAND); diff --git a/docs/mcp.md b/docs/mcp.md index 58f5bc04e3..c839b6aa37 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3787,8 +3787,8 @@ already walks Image Trace. Short agent entry points: samples of a stroke add up (two samples at the center at intensity 5 apply it in full). With `alt`, `userDefined` and `random` remove all of an instance's appearance items under the brush at once, whatever the brush's strength. A `style` name the document - has no graphic style for counts as none (the document's first style after the default one). The Symbol Styler sends - the style last clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or + has no graphic style for counts as none (the document's first style after the default one). The Symbol Styler and the + Symbol Sprayer (its User Defined Style) send the style last clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or Symbol Sprayer option that is not one of its names, a non-number `diameter`, `intensity` or `density`, a `diameter` outside 2..2000 or an `intensity` or `density` outside 1..10, a non-boolean switch, and a `symbol` or `style` that is neither a name nor null, and sets none of the values. The options dialog's OK checks the same way