diff --git a/crates/engine/src/cmd/live/blend.rs b/crates/engine/src/cmd/live/blend.rs index b09b476301..5334311789 100644 --- a/crates/engine/src/cmd/live/blend.rs +++ b/crates/engine/src/cmd/live/blend.rs @@ -92,7 +92,7 @@ pub(super) fn blend_make(s: &mut Session, p: &Value) -> Result { _ => defaults, }; let spacing = spacing_param(p, C, cur.spacing)?; - let orientation = orientation_param(p, cur.orientation); + let orientation = orientation_param(p, C, cur.orientation)?; let (ease0, color0, no_spine) = match base.as_ref().map(|n| &n.kind) { Some(NodeKind::Blend { spec, .. }) => (spec.ease, spec.color_shift, spec.no_spine), _ => (Default::default(), 0.0, !create_spine.creates_spine()), @@ -383,7 +383,8 @@ pub(super) fn blend_options(s: &mut Session, p: &Value) -> Result { // Nothing to set them on: the options new blends start with (easing is per blend). let d = s.prefs.blend_options.unwrap_or_default(); let spacing = spacing_param(p, C, d.spacing)?; - s.prefs.blend_options = Some(BlendDefaults { spacing, orientation: orientation_param(p, d.orientation), ..d }); + let orientation = orientation_param(p, C, d.orientation)?; + s.prefs.blend_options = Some(BlendDefaults { spacing, orientation, ..d }); return Ok(json!({ "defaults": true })); }; let no_spine = if id.is_some() { cur.no_spine } else { any_without_spine(s) }; @@ -394,13 +395,22 @@ pub(super) fn blend_options(s: &mut Session, p: &Value) -> Result { // were given and keeps its own for the rest, so editing several blends does not copy the first // one's options onto the others. let given = |key: &str| p.get(key).is_some_and(|v| !v.is_null()); - spacing_param(p, C, cur.spacing)?; + let has_count = given("value") || given("steps") || given("distance"); + let has_spacing = given("spacing") || has_count || p.get("smooth").and_then(Value::as_bool) == Some(true); + let spacing = spacing_param(p, C, cur.spacing)?; + let orientation = orientation_param(p, C, cur.orientation)?; let ease = ease_param(p, C, cur.ease)?; let color_shift = percent_param(p, C, "colorShift", cur.color_shift, -100.0)?; - let (has_kind, has_ramp, has_shift) = (given("easingType"), given("ramp"), given("colorShift")); + let (has_orientation, has_kind, has_ramp, has_shift) = (given("orientation"), given("easingType"), given("ramp"), given("colorShift")); let set = |spec: &mut BlendSpec| { - spec.spacing = spacing_param(p, C, spec.spacing).unwrap_or(spec.spacing); - spec.orientation = orientation_param(p, spec.orientation); + // A spacing mode without a count keeps the count of a blend already in that mode. + let same_mode = std::mem::discriminant(&spacing) == std::mem::discriminant(&spec.spacing); + if has_spacing && (has_count || !same_mode) { + spec.spacing = spacing; + } + if has_orientation { + spec.orientation = orientation; + } if has_kind { spec.ease.kind = ease.kind; } diff --git a/crates/engine/src/cmd/live/common.rs b/crates/engine/src/cmd/live/common.rs index 80c9d714a1..cfa3f32076 100644 --- a/crates/engine/src/cmd/live/common.rs +++ b/crates/engine/src/cmd/live/common.rs @@ -1,7 +1,7 @@ use super::mesh::whole; use super::{ Arc, BlendEase, BlendEaseType, BlendOrientation, BlendSpacing, Document, EngineError, Node, NodeId, NodeKind, Result, Selection, Session, Value, - bad, check_numbers, has_selection, json, named_ids, selected_roots, str_param, switch_or, + bad, check_numbers, has_selection, json, named_ids, selected_roots, switch_or, text_param, }; pub(super) fn ids_json(ids: &[NodeId]) -> Value { @@ -128,8 +128,11 @@ pub(super) fn spacing_param(p: &Value, cmd: &str, current: BlendSpacing) -> Resu let smooth = switch_or(p, "smooth", false, cmd)?; let num = |k: &str| p.get(k).and_then(Value::as_f64); let steps = |k: &str, n: f64| whole(n, k, cmd).map(|n| BlendSpacing::Steps(n as u32)); - let mode = str_param(p, "spacing"); + let mode = text_param(p, "spacing", cmd)?; let value = num("value"); + if mode.is_none() && value.is_some() { + return Err(bad(cmd, "`value` needs `spacing` (steps|distance)")); + } let sp = match mode { Some("smooth") | Some("smoothColor") => BlendSpacing::SmoothColor, Some("steps") => match value { @@ -157,11 +160,15 @@ pub(super) fn spacing_param(p: &Value, cmd: &str, current: BlendSpacing) -> Resu } } -pub(super) fn orientation_param(p: &Value, current: BlendOrientation) -> BlendOrientation { - match str_param(p, "orientation") { - Some("path") | Some("alignToPath") => BlendOrientation::AlignToPath, - Some("page") | Some("alignToPage") => BlendOrientation::AlignToPage, - _ => current, +/// `orientation`: `page` or `path`; missing or null keeps `current`, and any other value is an error. +pub(super) fn orientation_param(p: &Value, cmd: &str, current: BlendOrientation) -> Result { + match p.get("orientation").filter(|v| !v.is_null()) { + None => Ok(current), + Some(v) => match v.as_str() { + Some("path") | Some("alignToPath") => Ok(BlendOrientation::AlignToPath), + Some("page") | Some("alignToPage") => Ok(BlendOrientation::AlignToPage), + _ => Err(bad(cmd, "orientation must be page or path")), + }, } } diff --git a/crates/engine/src/tests/blendopts.rs b/crates/engine/src/tests/blendopts.rs index 576dce5b68..e9da509e02 100644 --- a/crates/engine/src/tests/blendopts.rs +++ b/crates/engine/src/tests/blendopts.rs @@ -811,6 +811,14 @@ fn options_on_several_blends_set_only_the_values_given() { s.execute("object.blend.options", &p).unwrap(); assert_eq!((spec(&s, b1).1, spec(&s, b2).1), (want1, want2), "{p}"); } + // A spacing mode without a count keeps the count of a blend already in that mode; a blend in + // another mode takes the mode's starting count. + s.execute("object.blend.options", &json!({"id": b2.0, "spacing": "distance", "value": 12})).unwrap(); + s.execute("object.blend.options", &json!({"spacing": "steps"})).unwrap(); + assert_eq!((spec(&s, b1).1.spacing, spec(&s, b2).1.spacing), (BlendSpacing::Steps(7), BlendSpacing::Steps(5))); + s.execute("object.blend.options", &json!({"id": b2.0, "spacing": "steps", "value": 12})).unwrap(); + s.execute("object.blend.options", &json!({"spacing": "steps"})).unwrap(); + assert_eq!((spec(&s, b1).1.spacing, spec(&s, b2).1.spacing), (BlendSpacing::Steps(7), BlendSpacing::Steps(12))); // The whole edit of both blends is one undo step. let depth = undo_len(&s); s.execute("object.blend.options", &json!({"colorShift": -5, "ramp": 5})).unwrap(); @@ -872,7 +880,7 @@ fn options_that_change_nothing_or_are_refused_record_no_undo_step() { let before = (spec(&s, b1).1, spec(&s, b2).1); let depth = undo_len(&s); // Values the blends already have, and no values at all. - for p in [json!({}), json!({"orientation": "page", "id": b2.0}), json!({"colorShift": 10, "id": b1.0})] { + for p in [json!({}), json!({"smooth": false}), json!({"orientation": "page", "id": b2.0}), json!({"colorShift": 10, "id": b1.0})] { s.execute("object.blend.options", &p).unwrap(); assert_eq!(undo_len(&s), depth, "{p}"); } @@ -886,8 +894,20 @@ fn options_that_change_nothing_or_are_refused_record_no_undo_step() { json!({"ramp": 50, "spacing": "steps", "value": 0}), json!({"ramp": 50, "spacing": "distance", "value": -3}), json!({"ramp": 50, "id": "b1"}), + json!({"ramp": 50, "orientation": "sideways"}), + json!({"ramp": 50, "orientation": 1}), + json!({"ramp": 50, "value": 3}), + json!({"ramp": 50, "spacing": 123}), ] { assert!(s.execute("object.blend.options", &p).is_err(), "{p}"); assert_eq!((spec(&s, b1).1, spec(&s, b2).1, undo_len(&s)), (before.0.clone(), before.1.clone(), depth), "{p}"); } + // Make and the options new blends start with refuse an unknown orientation too. + let error = s.execute("object.blend.make", &json!({"orientation": "sideways"})).unwrap_err().to_string(); + assert!(error.contains("orientation must be page or path"), "{error}"); + assert_eq!(undo_len(&s), depth); + s.execute("select.none", &json!({})).unwrap(); + let defaults = s.execute("object.blend.info", &json!({})).unwrap(); + assert!(s.execute("object.blend.options", &json!({"orientation": "sideways"})).is_err()); + assert_eq!(s.execute("object.blend.info", &json!({})).unwrap(), defaults); } diff --git a/crates/ui-egui/src/dialogs/blend_options.rs b/crates/ui-egui/src/dialogs/blend_options.rs index f988d702b1..dbc6be1862 100644 --- a/crates/ui-egui/src/dialogs/blend_options.rs +++ b/crates/ui-egui/src/dialogs/blend_options.rs @@ -36,6 +36,8 @@ pub fn open(app: &mut VectorcraftApp) -> Result { let target = fields["target"].clone(); let Some(o) = fields.as_object_mut() else { return Err("no blend options".into()) }; o.retain(|k, _| matches!(k.as_str(), "spacing" | "steps" | "distance" | "orientation")); + let opened = Value::Object(o.clone()); + o.insert("__opened".into(), opened); o.insert("__target".into(), target); o.insert("preview".into(), json!(true)); app.ui.dialog = Some(Dialog::new(KIND, fields)); @@ -47,13 +49,33 @@ fn on_blend(d: &Dialog) -> bool { d.str("__target") == "blend" } -/// `object.blend.options` parameters from the fields. +/// The field set when the spacing or its count is picked or typed in the dialog: OK then applies +/// it to every selected blend, even when it matches the first blend's. +const SET_SPACING: &str = "__setSpacing"; + +/// The field set when an orientation button is clicked, as [`SET_SPACING`] for the orientation. +const SET_ORIENTATION: &str = "__setOrientation"; + +/// `object.blend.options` parameters from the fields set in the dialog or differing from the +/// values it opened with, so each selected blend keeps its own values for the rest. fn params(d: &Dialog) -> Value { - let mut p = json!({"spacing": d.str("spacing"), "orientation": d.str("orientation")}); - match d.str("spacing").as_str() { - "steps" => p["steps"] = json!(d.f64("steps", 5.0).round().clamp(1.0, 1000.0)), - "distance" => p["distance"] = json!(d.f64("distance", 10.0)), - _ => {} + let opened = |k: &str| d.fields.get("__opened").and_then(|o| o.get(k)).cloned().unwrap_or(Value::Null); + let mode = d.str("spacing"); + let count = match mode.as_str() { + "steps" => Some(("steps", d.f64("steps", 5.0).round().clamp(1.0, 1000.0))), + "distance" => Some(("distance", d.f64("distance", 10.0))), + _ => None, + }; + let mut p = json!({}); + if d.bool(SET_SPACING) || opened("spacing") != json!(mode) || count.is_some_and(|(k, v)| opened(k).as_f64() != Some(v)) { + p["spacing"] = json!(mode); + if let Some((k, v)) = count { + p[k] = json!(v); + } + } + let orientation = d.str("orientation"); + if d.bool(SET_ORIENTATION) || opened("orientation") != json!(orientation) { + p["orientation"] = json!(orientation); } p } @@ -66,11 +88,14 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { widgets::label_row(ui, tl!("Spacing:"), LABEL_W, |ui| { if let Some((value, _)) = widgets::dropdown(ui, "blend-spacing", shown, &labels, 150.0).and_then(|i| SPACING.get(i)) { d.fields.insert("spacing".into(), json!(value)); + d.fields.insert(SET_SPACING.into(), json!(true)); } ui.add_space(6.0); match mode.as_str() { "distance" => { - form::length(ui, d, "distance", unit, 72.0); + if form::length(ui, d, "distance", unit, 72.0) { + d.fields.insert(SET_SPACING.into(), json!(true)); + } } // Smooth Color picks the count itself: the field shows the steps, disabled. m => { @@ -78,6 +103,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { ui.add_enabled_ui(m == "steps", |ui| { if let Some(n) = widgets::range_field(ui, "blend-steps", steps, 1.0..=1000.0, "", 0, 72.0) { d.fields.insert("steps".into(), json!(n)); + d.fields.insert(SET_SPACING.into(), json!(true)); } }); } @@ -89,6 +115,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool { for (value, along, tip) in [("page", false, tl!("Align to Page")), ("path", true, tl!("Align to Path"))] { if orientation_button(ui, along, path == along, tip) { d.fields.insert("orientation".into(), json!(value)); + d.fields.insert(SET_ORIENTATION.into(), json!(true)); } } }); @@ -193,6 +220,52 @@ mod tests { assert_eq!(app.session.doc().unwrap().history.undo.len(), depth + 1); } + #[test] + fn on_several_blends_ok_sets_only_the_fields_changed() { + let mut app = VectorcraftApp::new(Session::new(), Default::default()); + app.run("file.new", json!({"width": 300, "height": 300})).unwrap(); + let blend = |app: &mut VectorcraftApp, y: f64, options: Value| { + let ids: Vec = + [0.0, 200.0].map(|x| app.run("shape.rectangle", json!({"x": x, "y": y, "width": 20, "height": 20})).unwrap()["id"].clone()).into(); + app.run("select.set", json!({ "ids": ids })).unwrap(); + app.run("object.blend.make", options).unwrap()["id"].as_u64().unwrap() + }; + let a = blend(&mut app, 0.0, json!({"spacing": "steps", "steps": 3})); + let b = blend(&mut app, 100.0, json!({"spacing": "distance", "distance": 12, "orientation": "path"})); + let both = |app: &VectorcraftApp| { + let (sa, sb) = (spec(app, a), spec(app, b)); + ((sa.spacing, sa.orientation), (sb.spacing, sb.orientation)) + }; + app.run("select.set", json!({"ids": [a, b]})).unwrap(); + // The dialog shows the first blend's options; changing only the orientation leaves each + // blend's spacing as it was. + app.run("ui.blendOptions", json!({})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("orientation".into(), json!("path")); + frame(&mut app); + crate::dialogs::confirm(&mut app).unwrap(); + let path = BlendOrientation::AlignToPath; + assert_eq!(both(&app), ((BlendSpacing::Steps(3), path), (BlendSpacing::Distance(12.0), path))); + // Changing only the step count gives both blends that count and keeps their orientation. + app.run("object.blend.options", json!({"id": b, "orientation": "page"})).unwrap(); + app.run("ui.blendOptions", json!({})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert("steps".into(), json!(8)); + frame(&mut app); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(both(&app), ((BlendSpacing::Steps(8), path), (BlendSpacing::Steps(8), BlendOrientation::AlignToPage))); + // Clicking the orientation the first blend already has applies it to every selected blend. + app.run("ui.blendOptions", json!({})).unwrap(); + app.ui.dialog.as_mut().unwrap().fields.insert(SET_ORIENTATION.into(), json!(true)); + frame(&mut app); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(both(&app), ((BlendSpacing::Steps(8), path), (BlendSpacing::Steps(8), path))); + // OK without changes changes nothing and records no undo step. + let depth = app.session.doc().unwrap().history.undo.len(); + app.run("ui.blendOptions", json!({})).unwrap(); + frame(&mut app); + crate::dialogs::confirm(&mut app).unwrap(); + assert_eq!(app.session.doc().unwrap().history.undo.len(), depth); + } + #[test] fn with_nothing_selected_it_sets_what_new_blends_start_with() { let mut app = VectorcraftApp::new(Session::new(), Default::default()); diff --git a/crates/ui-egui/src/panels/blend.rs b/crates/ui-egui/src/panels/blend.rs index 64d936119a..d853668203 100644 --- a/crates/ui-egui/src/panels/blend.rs +++ b/crates/ui-egui/src/panels/blend.rs @@ -67,8 +67,8 @@ fn spacing_params(mode: &str, steps: f64, distance: f64) -> Value { } /// The Ramp or Shift slider: `key` of `object.blend.options` as a percentage from `min` to 100. -/// A drag previews the selected blends and its release records one undo step; a click on the -/// rail or an arrow key records one at once. +/// A drag, a press on the rail included, previews the selected blends and its release records one +/// undo step; a change without a drag, from the keyboard, records one at once. fn percent_slider(app: &mut VectorcraftApp, ui: &mut Ui, key: &str, value: Option, min: f64) { let mut v = value.unwrap_or(0.0).clamp(min, 100.0); let resp = widgets::slider(ui, egui::Slider::new(&mut v, min..=100.0).suffix("%")); @@ -124,8 +124,9 @@ fn settings(app: &mut VectorcraftApp, ui: &mut Ui) { }); let selected = info["target"] == "blend"; // Position easing needs a spine to run along: a replaced one, or Align to Path. A blend made - // without a spine has none. - let spined = info["hasSpine"] != false && (info["spine"]["explicit"] == true || info["orientation"] == "path"); + // without a spine has none, and easing is refused while one is selected. + let spined = + info["hasSpine"] != false && (info["spine"]["explicit"] == true || info["orientation"] == "path") && !selects_blend_without_spine(app); ui.add_enabled_ui(selected && spined, |ui| { let modes = ["easeIn", "easeOut", "easeInOut", "easeOutIn"]; let labels = [tl!("Ease In"), tl!("Ease Out"), tl!("Ease In Out"), tl!("Ease Out In")]; diff --git a/crates/ui-egui/src/panels/tests_blend.rs b/crates/ui-egui/src/panels/tests_blend.rs index 7b5d081efc..6b42d4693b 100644 --- a/crates/ui-egui/src/panels/tests_blend.rs +++ b/crates/ui-egui/src/panels/tests_blend.rs @@ -78,15 +78,18 @@ impl Frames { self.run(app, vec![]); } - /// Press at `from`, move to `to` in four steps, a frame each, and release there. - fn drag(&mut self, app: &mut VectorcraftApp, from: Pos2, to: Pos2) { - let button = |pos, pressed| Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE }; + /// Press at `from` and move to `to` in four steps, a frame each, keeping the button down. + fn press_and_move(&mut self, app: &mut VectorcraftApp, from: Pos2, to: Pos2) { self.run(app, vec![Event::PointerMoved(from)]); - self.run(app, vec![button(from, true)]); + self.run(app, vec![primary(from, true)]); for i in 1..=4 { self.run(app, vec![Event::PointerMoved(from + (to - from) * (i as f32 / 4.0))]); } - self.run(app, vec![button(to, false)]); + } + + /// Release the button at `at`. + fn release(&mut self, app: &mut VectorcraftApp, at: Pos2) { + self.run(app, vec![primary(at, false)]); self.run(app, vec![]); } @@ -110,6 +113,11 @@ impl Frames { } } +/// A press (`pressed`) or release of the primary button at `pos`. +fn primary(pos: Pos2, pressed: bool) -> Event { + Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE } +} + /// A document with two 20 pt squares 200 pt apart, both selected. fn app() -> VectorcraftApp { let mut app = VectorcraftApp::new(Session::new(), Default::default()); @@ -343,7 +351,13 @@ fn a_ramp_or_shift_drag_is_one_undo_step() { for index in [0, 1] { let (left, right) = f.slider(&mut app, index); let (before, depth) = (spec(&app, id), undo_depth(&app)); - f.drag(&mut app, left + (right - left) * 0.6, left + (right - left) * 0.9); + let (from, to) = (left + (right - left) * 0.6, left + (right - left) * 0.9); + f.press_and_move(&mut app, from, to); + // While the button is down the blend shows the new value, and no undo step is recorded yet. + assert!(app.session.in_interaction(), "the drag is in progress"); + assert_ne!(spec(&app, id), before, "the drag previews on the blend"); + assert_eq!(undo_depth(&app), depth); + f.release(&mut app, to); let after = spec(&app, id); assert!(!app.session.in_interaction(), "the release ends the drag"); if index == 0 { @@ -388,6 +402,29 @@ fn ramp_and_shift_edit_every_selected_blend_and_keep_their_other_options() { } } +#[test] +fn ramp_is_dimmed_while_a_selected_blend_has_no_spine() { + // The first selected blend has a spine and the second has none: the engine refuses easing for + // the pair, so the Ramp slider does not take a drag; Shift still edits both. + let mut app = app(); + let a = NodeId(app.run("object.blend.make", json!({"smooth": true, "orientation": "path"})).unwrap()["id"].as_u64().unwrap()); + let ids: Vec = + [0, 200].map(|x| app.run("shape.rectangle", json!({"x": x, "y": 100, "width": 20, "height": 20})).unwrap()["id"].clone()).into(); + app.run("select.set", json!({"ids": ids})).unwrap(); + let b = NodeId(app.run("object.blend.make", json!({"smooth": true, "createSpine": "never"})).unwrap()["id"].as_u64().unwrap()); + app.run("select.set", json!({"ids": [a.0, b.0]})).unwrap(); + let mut f = Frames::new(); + let (left, right) = f.slider(&mut app, 0); + let (before_a, before_b, depth) = (spec(&app, a), spec(&app, b), undo_depth(&app)); + let (from, to) = (left + (right - left) * 0.6, left + (right - left) * 0.9); + f.press_and_move(&mut app, from, to); + f.release(&mut app, to); + assert_eq!((spec(&app, a), spec(&app, b), undo_depth(&app), app.ui.status.as_str()), (before_a, before_b, depth, ""), "Ramp did nothing"); + let (left, right) = f.slider(&mut app, 1); + f.click(&mut app, left + (right - left) * 0.75); + assert!(spec(&app, a).color_shift > 0.0 && spec(&app, b).color_shift == spec(&app, a).color_shift); +} + #[test] fn fractional_ramp_and_shift_stay_as_they_are_while_the_panel_draws() { let mut app = app(); diff --git a/docs/mcp.md b/docs/mcp.md index e723c5ea3b..739f1b7c44 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -11814,10 +11814,13 @@ so its point at `t` moves by (dx, dy), turning a straight spine into a curve (`p `object.blend.options {id?, spacing?, value?, steps?, distance?, orientation?, smooth?, easingType?, ramp?, colorShift?}` sets the options of every selected blend, or of the blend `id` alone. Each blend takes only the options given and keeps its own value for the others, so a call with `colorShift` alone leaves each blend's spacing, orientation, type -and ramp as they were. A hidden or locked `id`, an `id` that is not a blend and a value out of range are errors that -change nothing, and a call that changes no blend records no undo step. With no blend selected and no `id`, the call -sets the spacing and orientation new blends start with. The Blend panel's Ramp and Shift sliders run it on the -selected blends: a drag previews and its release records one undo step. +and ramp as they were. `spacing` without `value`, `steps` or `distance` keeps the count of a blend already in that +mode, and a blend in another mode takes 5 steps or 10 pt. A hidden or locked `id`, an `id` that is not a blend, a +value out of range, a `spacing` that is not a string, an `orientation` other than `page` or `path`, and `value` +without `spacing` are errors that change +nothing, and a call that changes no blend records no undo step. With no blend selected and no `id`, the call sets the +spacing and orientation new blends start with. The Blend panel's Ramp and Shift sliders run it on the selected blends: +a drag previews and its release records one undo step. Blend Options sends only the spacing or orientation set in the dialog. `object.blend.setEasing {id?, easingType?, ramp?, colorShift?}` sets one blend's easing and color shift (the first selected blend without `id`) and returns `{id, easingType, ramp, colorShift, changed}`; omitted values are kept. diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 3d5ed5a5ac..ac9a209bdc 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -1666,7 +1666,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur When the object the Blend tool picked first is deleted or undone away before the second click, the next click on an object picks that object first instead of doing nothing. Regression tests: `blend_tool_picks_again_when_its_first_pick_is_gone` in `meshblend.rs` and `the_blend_tool_picks_again_when_its_first_pick_is_deleted` in `tests/blendopts.rs`. Window › Blend opens the Blend panel: Make, the selected blend's Spacing and Orientation (with no blend selected, the options new blends start with), Reverse Front to Back, Reverse Spine, Replace Spine, Expand and Release, each running its Object › Blend command. Make is dimmed until two or more objects are selected. Spacing and Orientation are dimmed until a blend or two or more objects are selected, and the other buttons are dimmed until a blend is selected. The Blend panel's Create Spine menu (Auto, Always, Never; `object.blend.createSpine`) sets whether new blends get a spine, from the Blend tool, Make and `object.blend.make` alike ([Blend panel overview](https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blend-panel-overview.html)). Auto and Always give every new blend a straight spine, as before; Never makes blends without one, which keep their steps on the straight lines between the keys, have Type and Ramp dimmed, refuse Reverse Spine and spine edits, release without a spine path, and get a spine from Replace Spine. The setting is kept with the preferences and leaves blends already made as they are; Auto as the starting value and keeping the setting across sessions are VectorCraft's own rules. Builds on #5177 by adambelis. Evidence: `tests::blendopts::{create_spine_sets_whether_new_blends_get_a_spine, a_blend_without_a_spine_has_none_to_edit_reverse_ease_or_release, whether_a_blend_has_a_spine_is_saved_and_old_blends_have_one}` and `panels::tests_blend::create_spine_sets_what_new_blends_get_whatever_is_selected`. - Blend Options on several selected blends (the Blend panel's Type, Ramp and Shift, and `object.blend.options`) sets only the values given, and each blend keeps its own spacing, orientation, type, ramp and shift for the rest instead of taking the first blend's. `object.blend.options {id}` edits that blend alone; a hidden or locked blend, an object that is not a blend and a value out of range are errors that change nothing, and a call that changes nothing records no undo step. A drag of the panel's Ramp or Shift slider previews on the canvas and records one undo step on release. Builds on #8022 by ruchirguitar. Evidence: `tests::blendopts::{options_on_several_blends_set_only_the_values_given, options_with_an_id_edit_that_blend_alone, options_that_change_nothing_or_are_refused_record_no_undo_step}` and `panels::tests_blend::{a_ramp_or_shift_drag_is_one_undo_step, ramp_and_shift_edit_every_selected_blend_and_keep_their_other_options, fractional_ramp_and_shift_stay_as_they_are_while_the_panel_draws}`. + Blend Options on several selected blends (the Blend Options dialog, the Blend panel's Type, Ramp and Shift, and `object.blend.options`) sets only the values given or set in the dialog, and each blend keeps its own spacing, orientation, type, ramp and shift for the rest instead of taking the first blend's; a spacing mode given without a count keeps the count of a blend already in that mode. `object.blend.options {id}` edits that blend alone; a hidden or locked blend, an object that is not a blend, a value out of range and an unknown orientation are errors that change nothing, and a call that changes nothing records no undo step. A drag of the panel's Ramp or Shift slider previews on the canvas and records one undo step on release, and Type and Ramp are dimmed while a selected blend has no spine. Builds on #8022 by ruchirguitar. Evidence: `tests::blendopts::{options_on_several_blends_set_only_the_values_given, options_with_an_id_edit_that_blend_alone, options_that_change_nothing_or_are_refused_record_no_undo_step}`, `dialogs::blend_options::tests::on_several_blends_ok_sets_only_the_fields_changed` and `panels::tests_blend::{a_ramp_or_shift_drag_is_one_undo_step, ramp_and_shift_edit_every_selected_blend_and_keep_their_other_options, ramp_is_dimmed_while_a_selected_blend_has_no_spine}`. With the Blend tool, Escape drops the object clicked first and stops the next click adding to the blend just made, so the next click picks a new first object; the document and the selection stay as they are. Regression tests: `escape_drops_the_blend_tools_first_pick` in `meshblend.rs` and `tests/blendopts.rs`. Objects on Path (#2545): a click with the Objects on Path tool (in Edit Toolbar's Modify section and the Blend tool's flyout; Object › Objects on Path › Attach and the context menu with two or more objects selected choose it) attaches the selected objects to the path clicked, open or closed, in an Objects on Path group with the path at its bottom. The objects go along the path column by column from left to right, spread evenly from its first anchor (the last one sits on the end of an open path), each turned to the path at its attachment point; Pivot and Rotate set where each one attaches and how far it tilts (`object.objectsOnPath.attach`, `object.objectsOnPath.options`), and with Objects on Path groups selected the Properties panel's Objects on Path Options section shows them as a nine-point Pivot grid and a Rotate field with common angles, each change one undo step for every selected group. Editing the path moves the objects, an object moved on its own goes back, objects moved into or out of the group in the Layers panel join or leave the path, and Object › Objects on Path › Expand leaves a plain group. The group saves and reopens live and exports as plain art. With one Objects on Path group selected, the Selection and Objects on Path tools show the Rotate All widget beside its first object: dragging it turns every object about its attachment point by the angle the pointer turns, adding it to the group's Rotate in one undo step, in 15° steps with Shift ([Objects on Path](https://helpx.adobe.com/illustrator/using/objects-on-path.html)). Detach is in its own entry below. Objects on Path Space widget: with one Objects on Path group of two or more objects selected, the Selection and Objects on Path tools show a square handle beyond its last object; dragging it along the path, round its bends, sets the distance between the objects' attachment points in one undo step, the first object staying where it is, and with Alt (Option on macOS) the objects spread from both ends toward the center; the distance shows next to the pointer during the drag, in the document's units ([Rearrange and edit objects on a path](https://helpx.adobe.com/illustrator/desktop/manage-objects/arrange-objects/rearrange-and-edit-objects-on-a-path.html), [Objects on Path](https://helpx.adobe.com/illustrator/using/objects-on-path.html)). The group keeps the distance (`object.objectsOnPath.options {spacing, start}`) through Pivot and Rotate changes, path edits, copies, saving and reopening, and scales it with the group; by default (`"auto"`) the objects are spread evenly as before. Evidence: `objects_on_path::tests::{space_sets_the_distance_between_the_stops, space_on_a_closed_path_wraps_at_the_first_anchor_and_stops_short_of_the_first_object}` in `crates/doc`, `tests::objects_on_path::space_sets_the_distance_between_the_objects_in_one_undo_step` in `crates/engine`, `objects_on_path::tests::dragging_the_space_widget_spaces_the_objects_from_the_first_one` in `crates/tools`.