From 52c365af1a342b52f6aa70809c2bb1ac19dba446 Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 15:54:04 +0100 Subject: [PATCH 01/17] Add Anchor Point: a drag from a segment pulls out the new anchor's handles (#12707) The drag after an add now pulls out the new anchor's handles as the Pen does: the outgoing handle follows the pointer and the incoming one mirrors it. Shift turns the handle to the nearest 45 degrees (an axis keeps the major component, a diagonal takes min(|dx|, |dy|)), Alt breaks the pair, Space moves the anchor with its handles. The add and the drag stay one history step, Add Anchor Point. A click without movement is the plain add, as before. The Pen's Auto Add keeps moving the anchor it adds. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/canvas.rs | 2 + crates/ui-egui/src/tools/anchor_tools.rs | 145 ++++++++++- .../anchor_tools/add_anchor_drag_tests.rs | 235 ++++++++++++++++++ .../ui-egui/src/tools/anchor_tools/tests.rs | 7 +- crates/ui-egui/src/tools/direct_select.rs | 53 ++-- 5 files changed, 416 insertions(+), 26 deletions(-) create mode 100644 crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index d4ce67ba24..8877bcb5e4 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -2495,6 +2495,8 @@ pub fn canvas_view(app: &mut PhotocraftApp, ui: &mut egui::Ui, idx: usize, rect: d.reposition = reposition; drawing = true; } + // Space during Add Anchor Point's handle drag moves the new anchor (#12707). + drawing |= crate::anchor_tools::set_reposition(app, reposition); let temporary = crate::hold_keys::for_frame(app, &ctx, drawing || crate::type_transform::active(app)); let space_pan = temporary == Some(crate::hold_keys::Temporary::Hand); let middle = ui.input(|i| i.pointer.middle_down()); diff --git a/crates/ui-egui/src/tools/anchor_tools.rs b/crates/ui-egui/src/tools/anchor_tools.rs index f36814934c..9429c3292c 100644 --- a/crates/ui-egui/src/tools/anchor_tools.rs +++ b/crates/ui-egui/src/tools/anchor_tools.rs @@ -6,7 +6,8 @@ //! * Add Anchor Point: hovering a segment highlights it and shows where the anchor would go; a //! click inserts it there (`path.addAnchor`). A curve is split without changing its shape, into //! a smooth anchor; a straight segment gets a corner. The new anchor is selected with its -//! direction handles showing, and a drag from the click moves it, as in Photoshop (#8653). +//! direction handles showing (#8653), and a drag from the click pulls out its handles as the Pen +//! does (#12707, [`Pull`]): ⇧ turns them to 45°, ⌥ breaks the pair and Space moves the anchor. //! * Delete Anchor Point: hovering an anchor highlights it; a click removes it //! (`path.deleteAnchor`), joining its neighbours. //! * ⌥ swaps the two tools and ⌘/Ctrl is Direct Selection (`direct_select`) while held; ⌥-click @@ -169,7 +170,7 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool if r == PathRef::Pen { edit_pen(app, path, hit, [x, y]); } else { - apply(app, r, hit, [x, y]); + apply(app, r, hit, [x, y], false); } return true; } @@ -263,12 +264,12 @@ fn click(app: &mut PhotocraftApp, tool: Tool, p: [f64; 2]) { select_shown(app, r, vec![s], vec![[s, k]]); return; } - if apply(app, r, hit, p) { + if apply(app, r, hit, p, false) { select_follower(app, r, &path, [s, k]); } return; } - apply(app, r, hit, p); + apply(app, r, hit, p, true); } /// Show the anchors of `subpaths` of `r` only, with `anchors` selected: a view change, no history step. @@ -325,11 +326,12 @@ fn edit_pen(app: &mut PhotocraftApp, mut path: Path, hit: Hit, p: [f64; 2]) { } /// Add an anchor where `hit` is on a segment of `r`, or delete the anchor it is on: one command. -/// An added anchor is selected and follows a drag from the press at `p`; the add and the move are -/// one history step. +/// An added anchor is selected and a drag from the press at `p` pulls out its handles (`pull`, Add +/// Anchor Point, #12707) or moves it (the Pen's Auto Add, #8653); the add and the drag are one +/// history step. /// Whether the engine ran the edit: not at a full History (it records a step and evicts the oldest, so /// the step count does not change), nor when a live-shape prompt or an error stopped it. -fn apply(app: &mut PhotocraftApp, r: PathRef, hit: Hit, p: [f64; 2]) -> bool { +fn apply(app: &mut PhotocraftApp, r: PathRef, hit: Hit, p: [f64; 2], pull: bool) -> bool { let (id, mut params, coalesce) = match hit { Hit::Segment([s, k], t) => { let key = format!("add-anchor-{}", app.ui.alloc_id()); @@ -353,6 +355,7 @@ fn apply(app: &mut PhotocraftApp, r: PathRef, hit: Hit, p: [f64; 2]) -> bool { let n = |f: &str| v["anchor"][f].as_u64().and_then(|v| usize::try_from(v).ok()); let base = crate::direct_select::candidates(app).into_iter().find(|(c, _)| *c == r).map(|(_, path)| path); match (n("subpath"), n("knot"), base) { + (Some(s), Some(k), Some(base)) if pull => start_pull(app, r, base, [s, k], p, coalesce), (Some(s), Some(k), Some(base)) => crate::direct_select::grab_added(app, r, base, [s, k], p, coalesce), _ => app.ui.direct_selection = DirectSelection { target: Some(r), ..Default::default() }, } @@ -368,6 +371,131 @@ fn apply(app: &mut PhotocraftApp, r: PathRef, hit: Hit, p: [f64; 2]) -> bool { ok } +/// Select the anchor Add Anchor Point just put at knot `k` of `target` and start pulling out its +/// handles from the press `p` ([`Pull`]); `coalesce` joins the drag to the add's history step. +fn start_pull(app: &mut PhotocraftApp, target: PathRef, base: Path, k: [usize; 2], p: [f64; 2], coalesce: Option) { + use crate::direct_select::{Drag, Edit}; + let Some(anchor) = base.subpaths.get(k[0]).and_then(|sp| sp.knots.get(k[1])).map(|kn| kn.anchor) else { + app.ui.direct_selection = DirectSelection { target: Some(target), ..Default::default() }; + return; + }; + app.ui.direct_selection = DirectSelection { target: Some(target), anchors: vec![k], coalesce, owner: Owner::current(app), ..Default::default() }; + app.ui.direct_selection.drag = Some(Drag::Edit { target, base, edit: Edit::Pull(Pull::new(k, anchor, p)), start: p, end: p, preview: None }); +} + +/// Add Anchor Point's drag from the anchor it just added (#12707), as the Pen pulls out a new +/// anchor's handles and as measured in the reference application: the outgoing handle follows the +/// pointer and the incoming one mirrors it through the anchor. ⇧ turns the handle to the nearest +/// 45° ([`snap45_handle`]); ⌥ pressed during the drag breaks the pair, so from then on only the +/// outgoing handle follows; Space held moves the anchor with its handles, and letting it go goes +/// back to the handle. Committed on release in the add's history step ([`Pull::commands`]). +#[derive(Clone, Debug, PartialEq)] +pub struct Pull { + /// The added knot, `[subpath, knot]`. + pub(crate) knot: [usize; 2], + /// Where the add put the anchor. + from: Point, + /// The anchor now (Space moves it). + anchor: Point, + /// The outgoing handle. + out: Point, + /// The incoming handle once ⌥ broke the pair; `None` mirrors `out`. + broken_in: Option, + /// The pointer at the last event: Space moves the anchor by the pointer's steps. + last: [f64; 2], + /// Space is held (set each frame by the canvas, [`set_reposition`]). + reposition: bool, +} + +impl Pull { + fn new(knot: [usize; 2], anchor: Point, press: [f64; 2]) -> Self { + Self { knot, from: anchor, anchor, out: anchor, broken_in: None, last: press, reposition: false } + } + + fn in_ctrl(&self) -> Point { + self.broken_in.unwrap_or(Point::new(2.0 * self.anchor.x - self.out.x, 2.0 * self.anchor.y - self.out.y)) + } + + /// The pointer moved to `p` with `mods` held. + pub(crate) fn step(&mut self, p: [f64; 2], mods: Modifiers) { + if !(p[0].is_finite() && p[1].is_finite()) { + return; + } + if self.reposition { + let d = [p[0] - self.last[0], p[1] - self.last[1]]; + let by = |q: Point| Point::new(q.x + d[0], q.y + d[1]); + self.anchor = by(self.anchor); + self.out = by(self.out); + self.broken_in = self.broken_in.map(by); + } else { + if mods.alt && self.broken_in.is_none() { + self.broken_in = Some(self.in_ctrl()); + } + let [x, y] = if mods.shift { snap45_handle([self.anchor.x, self.anchor.y], p) } else { p }; + self.out = Point::new(x, y); + } + self.last = p; + } + + /// `path` with the knot as the drag has it so far: the preview. + pub(crate) fn apply(&self, path: &mut Path) -> Result<(), String> { + let k = path.subpaths.get_mut(self.knot[0]).and_then(|sp| sp.knots.get_mut(self.knot[1])).ok_or("no such anchor")?; + (k.anchor, k.in_ctrl, k.out_ctrl) = (self.anchor, self.in_ctrl(), self.out); + k.smooth = self.broken_in.is_none(); + Ok(()) + } + + /// The commands that make the knot what [`Pull::apply`] shows (without target or coalesce): + /// move the anchor if Space did, set the mirrored handles, and with the pair broken the + /// incoming handle on its own. + pub(crate) fn commands(&self) -> Vec<(&'static str, serde_json::Value)> { + let [s, k] = self.knot; + let mut cmds = Vec::new(); + let d = [self.anchor.x - self.from.x, self.anchor.y - self.from.y]; + if d != [0.0, 0.0] { + cmds.push(("path.moveAnchors", serde_json::json!({"anchors": [[s, k]], "move": d}))); + } + cmds.push(("path.convertPoint", serde_json::json!({"subpath": s, "knot": k, "out": [self.out.x, self.out.y]}))); + if let Some(i) = self.broken_in { + cmds.push(("path.moveHandle", serde_json::json!({"subpath": s, "knot": k, "handle": "in", "to": [i.x, i.y], "independent": true}))); + } + cmds + } +} + +/// ⇧ on a handle being pulled out (#12707): the nearest 45° direction from the anchor at `origin`, +/// as measured in the reference application. An axis keeps the drag's major component, a diagonal +/// takes min(|dx|, |dy|) for both: (+30, +80) → (+0, +80), (+70, +40) → (+40, +40). +fn snap45_handle(origin: [f64; 2], p: [f64; 2]) -> [f64; 2] { + let (dx, dy) = (p[0] - origin[0], p[1] - origin[1]); + if !(dx.is_finite() && dy.is_finite()) { + return p; + } + let (ax, ay) = (dx.abs(), dy.abs()); + // tan 22.5°: below it the drag is nearer the axis than the diagonal. + let tan = std::f64::consts::FRAC_PI_8.tan(); + if ay <= ax * tan { + [p[0], origin[1]] + } else if ax <= ay * tan { + [origin[0], p[1]] + } else { + let m = ax.min(ay); + [origin[0] + m.copysign(dx), origin[1] + m.copysign(dy)] + } +} + +/// Space held or not (`held`) for Add Anchor Point's handle drag, if one is going on: true when it +/// is, so the canvas keeps Space from panning, as it does for the Pen's drag. +pub fn set_reposition(app: &mut PhotocraftApp, held: bool) -> bool { + match app.ui.direct_selection.drag.as_mut() { + Some(crate::direct_select::Drag::Edit { edit: crate::direct_select::Edit::Pull(pull), .. }) => { + pull.reposition = held; + true + } + _ => false, + } +} + /// The hover feedback over the Direct Selection overlay: Add highlights the segment under the /// pointer and shows the anchor a click would add; Delete highlights the anchor it would remove. pub fn draw_hover(app: &PhotocraftApp, painter: &egui::Painter, to_scr: &dyn Fn([f64; 2]) -> Pos2, accent: Color32, mods: Modifiers) { @@ -435,3 +563,6 @@ mod delete_anchor_shown_anchors_tests; #[cfg(test)] mod delete_anchor_alt_tests; + +#[cfg(test)] +mod add_anchor_drag_tests; diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs new file mode 100644 index 0000000000..5ccf72b5dc --- /dev/null +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs @@ -0,0 +1,235 @@ +//! #12707: a drag from a segment with Add Anchor Point inserts the anchor and pulls out its +//! handles, as the Pen does: the outgoing handle follows the pointer and the incoming one mirrors +//! it. ⇧ turns the handle to 45°, ⌥ breaks the pair, Space moves the anchor; the add and the drag +//! are one history step, Add Anchor Point. + +use egui::Modifiers; +use photocraft_doc::Knot; +use photocraft_geom::Point; +use serde_json::json; + +use crate::PhotocraftApp; +use crate::canvas::{ToolEvent, tool_event}; +use crate::direct_select::PathRef; +use crate::state::Tool; + +/// 600 x 600 with the closed corner square (100,300) (300,300) (300,500) (100,500) as the saved +/// path "Path 1", selected in the Paths panel, and Add Anchor Point picked. +fn square() -> PhotocraftApp { + let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()); + app.session.execute("file.new", json!({"width": 600, "height": 600})).unwrap(); + app.sync_views(); + app.ui.tool = Tool::AddAnchorPoint; + app.ui.extras.snap = false; + let path = json!({"subpaths": [{"closed": true, "knots": [[100, 300], [300, 300], [300, 500], [100, 500]]}]}); + app.run("path.set", json!({"name": "Path 1", "path": path})).unwrap(); + app.ui.selected_path = Some("Path 1".into()); + app +} + +fn saved(app: &PhotocraftApp) -> photocraft_doc::vector::Path { + crate::direct_select::path_of(app, &PathRef::Saved(0)).unwrap().into_owned() +} + +fn steps(app: &PhotocraftApp) -> usize { + app.session.active().unwrap().history.entries().len() +} + +fn undo_label(app: &PhotocraftApp) -> Option { + app.session.active().unwrap().history.undo_label().map(str::to_owned) +} + +fn down(app: &mut PhotocraftApp, at: [f64; 2]) { + tool_event(app, ToolEvent::Down { x: at[0], y: at[1], pressure: 1.0 }, Modifiers::NONE); +} + +fn to(app: &mut PhotocraftApp, at: [f64; 2], mods: Modifiers) { + tool_event(app, ToolEvent::Move { x: at[0], y: at[1], pressure: 1.0 }, mods); +} + +fn up(app: &mut PhotocraftApp, at: [f64; 2], mods: Modifiers) { + tool_event(app, ToolEvent::Up { x: at[0], y: at[1] }, mods); +} + +/// The knot at `anchor` (within a pixel) on `path`. +fn knot_at(path: &photocraft_doc::vector::Path, anchor: [f64; 2]) -> Knot { + let near = |p: Point| (p.x - anchor[0]).hypot(p.y - anchor[1]) <= 1.0; + *path.subpaths[0].knots.iter().find(|k| near(k.anchor)).unwrap_or_else(|| panic!("no anchor at {anchor:?}: {path:?}")) +} + +#[track_caller] +fn assert_knot(k: &Knot, anchor: [f64; 2], out: [f64; 2], inc: [f64; 2]) { + let near = |p: Point, q: [f64; 2]| (p.x - q[0]).hypot(p.y - q[1]) <= 0.5; + assert!(near(k.anchor, anchor) && near(k.out_ctrl, out) && near(k.in_ctrl, inc), "want anchor {anchor:?} out {out:?} in {inc:?}, got {k:?}"); +} + +#[test] +fn a_drag_from_the_bottom_edge_pulls_out_mirrored_handles_in_one_step() { + let mut app = square(); + let (before, n) = (saved(&app), steps(&app)); + down(&mut app, [200.0, 500.0]); + for y in [520.0, 540.0, 560.0] { + to(&mut app, [200.0, y], Modifiers::NONE); + } + up(&mut app, [200.0, 560.0], Modifiers::NONE); + let path = saved(&app); + assert_eq!(path.subpaths[0].knots.len(), 5); + let k = knot_at(&path, [200.0, 500.0]); + assert_knot(&k, [200.0, 500.0], [200.0, 560.0], [200.0, 440.0]); + assert!(k.smooth); + assert_eq!((steps(&app), undo_label(&app).as_deref()), (n + 1, Some("Add Anchor Point"))); + assert!(app.session.undo()); + assert_eq!(saved(&app), before, "one undo takes back the add and the pull"); +} + +#[test] +fn shift_turns_the_handle_to_45_degrees_and_the_in_handle_mirrors_it() { + // The anchor goes in at (200,500); the drags are offsets from it. + for (d, want) in [ + ([30.0, 80.0], [0.0, 80.0]), + ([70.0, 40.0], [40.0, 40.0]), + ([-50.0, -60.0], [-50.0, -50.0]), + ([60.0, -20.0], [60.0, 0.0]), + ([50.0, 45.0], [45.0, 45.0]), + ] { + let mut app = square(); + down(&mut app, [200.0, 500.0]); + let at = [200.0 + d[0], 500.0 + d[1]]; + to(&mut app, at, Modifiers::SHIFT); + up(&mut app, at, Modifiers::SHIFT); + let k = knot_at(&saved(&app), [200.0, 500.0]); + assert_knot(&k, [200.0, 500.0], [200.0 + want[0], 500.0 + want[1]], [200.0 - want[0], 500.0 - want[1]]); + } +} + +#[test] +fn alt_during_the_drag_breaks_the_pair_so_only_the_out_handle_follows() { + let mut app = square(); + let n = steps(&app); + down(&mut app, [100.0, 400.0]); + to(&mut app, [40.0, 400.0], Modifiers::NONE); + to(&mut app, [40.0, 420.0], Modifiers::ALT); + to(&mut app, [40.0, 440.0], Modifiers::ALT); + up(&mut app, [40.0, 440.0], Modifiers::ALT); + let k = knot_at(&saved(&app), [100.0, 400.0]); + assert_knot(&k, [100.0, 400.0], [40.0, 440.0], [160.0, 400.0]); + assert_eq!((steps(&app), undo_label(&app).as_deref()), (n + 1, Some("Add Anchor Point"))); +} + +#[test] +fn space_moves_the_anchor_with_its_handles_and_letting_go_returns_to_the_handle() { + let mut app = square(); + let n = steps(&app); + down(&mut app, [300.0, 400.0]); + to(&mut app, [340.0, 400.0], Modifiers::NONE); + assert!(crate::anchor_tools::set_reposition(&mut app, true), "the canvas keeps Space from panning"); + to(&mut app, [340.0, 420.0], Modifiers::NONE); + to(&mut app, [340.0, 440.0], Modifiers::NONE); + crate::anchor_tools::set_reposition(&mut app, false); + to(&mut app, [352.0, 440.0], Modifiers::NONE); + up(&mut app, [352.0, 440.0], Modifiers::NONE); + let k = knot_at(&saved(&app), [300.0, 440.0]); + assert_knot(&k, [300.0, 440.0], [352.0, 440.0], [248.0, 440.0]); + assert_eq!((steps(&app), undo_label(&app).as_deref()), (n + 1, Some("Add Anchor Point"))); + assert!(!crate::anchor_tools::set_reposition(&mut app, true), "no drag, nothing to reposition"); +} + +/// The Space case through the real canvas: the held key reaches the drag, and the view does not pan. +#[test] +fn space_in_the_canvas_moves_the_anchor_instead_of_panning() { + use egui::{Event, Key, PointerButton, pos2}; + let mut a = square(); + a.ui.extras.rulers = false; + a.ui.views = vec![crate::state::View { + zoom: 1.0, + center: [300.0, 300.0], + fit_pending: false, + fill_pending: false, + doc_size: [600, 600], + rotation: 0.0, + zoom_animating: false, + zoom_anchor: None, + display_camera: None, + zoom_transition: None, + }]; + let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(600.0, 600.0)).build_ui_state( + |ui, app: &mut PhotocraftApp| { + let v = app.ui.views[0].clone(); + crate::canvas::canvas_view(app, ui, 0, ui.max_rect(), v, true); + }, + a, + ); + h.run_steps(2); + let rect = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(600.0, 600.0)); + let xf = crate::canvas::ViewXform { rect, zoom: 1.0, center: [300.0, 300.0], flip: false, rotation: 0.0, aspect: 1.0 }; + let button = |pos, pressed| Event::PointerButton { pos, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }; + let space = |pressed| Event::Key { key: Key::Space, physical_key: None, pressed, repeat: false, modifiers: Modifiers::NONE }; + let press = xf.to_screen(300.0, 400.0); + h.event(Event::PointerMoved(press)); + h.step(); + h.event(button(press, true)); + h.step(); + let mv = |h: &mut egui_kittest::Harness<'_, PhotocraftApp>, x: f32, y: f32| { + let p = xf.to_screen(x, y); + h.event(Event::PointerMoved(pos2(p.x, p.y))); + h.step(); + }; + for x in [320.0, 340.0] { + mv(&mut h, x, 400.0); + } + h.event(space(true)); + h.step(); + for y in [420.0, 440.0] { + mv(&mut h, 340.0, y); + } + h.event(space(false)); + h.step(); + mv(&mut h, 352.0, 440.0); + let end = xf.to_screen(352.0, 440.0); + h.event(button(end, false)); + h.run_steps(2); + assert_eq!(h.state().ui.views[0].center, [300.0, 300.0], "Space did not pan"); + let k = knot_at(&saved(h.state()), [300.0, 440.0]); + assert_knot(&k, [300.0, 440.0], [352.0, 440.0], [248.0, 440.0]); +} + +#[test] +fn the_drag_works_on_a_shape_layers_path_in_one_step() { + // 800 x 600, a shape from (450,100) to (650,250), made the active layer. + let (mut app, shape) = super::delete_anchor_targeted_path_tests::setup(Tool::AddAnchorPoint); + super::delete_anchor_targeted_path_tests::select_layer(&mut app, shape); + app.ui.extras.snap = false; + let n = steps(&app); + down(&mut app, [550.0, 250.0]); + to(&mut app, [550.0, 280.0], Modifiers::NONE); + to(&mut app, [550.0, 300.0], Modifiers::NONE); + up(&mut app, [550.0, 300.0], Modifiers::NONE); + let path = crate::direct_select::path_of(&app, &PathRef::Layer(shape)).unwrap().into_owned(); + assert_knot(&knot_at(&path, [550.0, 250.0]), [550.0, 250.0], [550.0, 300.0], [550.0, 200.0]); + assert_eq!((steps(&app), undo_label(&app).as_deref()), (n + 1, Some("Add Anchor Point"))); +} + +#[test] +fn a_click_without_movement_keeps_the_plain_add() { + let mut app = square(); + let mut want = saved(&app); + let Some(photocraft_vector::edit::Hit::Segment(k, t)) = photocraft_vector::edit::hit(&want, Point::new(200.0, 500.0), 6.0, &[]) else { + panic!("no segment") + }; + photocraft_vector::edit::add_anchor(&mut want, k, t).unwrap(); + let n = steps(&app); + down(&mut app, [200.0, 500.0]); + up(&mut app, [200.0, 500.0], Modifiers::NONE); + assert_eq!(saved(&app), want, "only the add"); + assert_eq!((steps(&app), undo_label(&app).as_deref()), (n + 1, Some("Add Anchor Point"))); +} + +#[test] +fn non_finite_pointer_positions_leave_the_drag_alone() { + let mut app = square(); + down(&mut app, [200.0, 500.0]); + to(&mut app, [200.0, 560.0], Modifiers::NONE); + to(&mut app, [f64::NAN, f64::INFINITY], Modifiers::SHIFT); + up(&mut app, [200.0, 560.0], Modifiers::NONE); + assert_knot(&knot_at(&saved(&app), [200.0, 500.0]), [200.0, 500.0], [200.0, 560.0], [200.0, 440.0]); +} diff --git a/crates/ui-egui/src/tools/anchor_tools/tests.rs b/crates/ui-egui/src/tools/anchor_tools/tests.rs index ae58b9b611..5200c0c785 100644 --- a/crates/ui-egui/src/tools/anchor_tools/tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/tests.rs @@ -386,11 +386,12 @@ fn an_added_anchor_on_a_curve_is_selected_smooth_and_shows_its_handles() { assert_eq!(work(&app), before); } -/// #8653: a drag from the click moves the anchor it adds, handles and all; the -/// add and the move are one history step, for the Add Anchor Point tool and the Pen's Auto Add. +/// #8653: with the Pen's Auto Add a drag from the click moves the anchor it adds, handles and all; +/// the add and the move are one history step. (Add Anchor Point's drag pulls out the handles +/// instead, #12707: `add_anchor_drag_tests`.) #[test] fn dragging_from_an_add_moves_the_new_anchor_in_one_step() { - for tool in [Tool::AddAnchorPoint, Tool::Pen] { + for tool in [Tool::Pen] { let mut app = app(tool); with_path(&mut app); let (before, n) = (work(&app), steps(&app)); diff --git a/crates/ui-egui/src/tools/direct_select.rs b/crates/ui-egui/src/tools/direct_select.rs index 3ee51b3862..ae15462b67 100644 --- a/crates/ui-egui/src/tools/direct_select.rs +++ b/crates/ui-egui/src/tools/direct_select.rs @@ -279,6 +279,8 @@ pub enum Edit { Path(Vec<[usize; 2]>), /// Pen + ⌥ on an anchor: a click makes a corner, a drag pulls out smooth handles. Convert([usize; 2]), + /// Add Anchor Point's drag from the anchor it just added: pulls out its handles (#12707). + Pull(crate::anchor_tools::Pull), } impl Edit { @@ -288,7 +290,14 @@ impl Edit { if shift && matches!(self, Edit::Anchors(_)) { crate::stroke_constraint::snap45_anchor(start, p) } else { p } } - /// The edit for a drag from `start` to `end`, as a command and its params (without target). + /// The edit for a drag from `start` to `end`, as commands and their params (without target). + fn commands(&self, start: [f64; 2], end: [f64; 2]) -> Vec<(&'static str, Value)> { + if let Edit::Pull(pull) = self { + return pull.commands(); + } + vec![self.command(start, end)] + } + fn command(&self, start: [f64; 2], end: [f64; 2]) -> (&'static str, Value) { let d = [end[0] - start[0], end[1] - start[1]]; match self { @@ -300,6 +309,7 @@ impl Edit { Edit::Segment([s, k], t) => ("path.bendSegment", json!({"subpath": s, "knot": k, "t": t, "move": d})), Edit::Path(a) => ("path.moveAnchors", json!({"anchors": a, "move": d, "stepName": "Drag Path"})), Edit::Convert([s, k]) => ("path.convertPoint", json!({"subpath": s, "knot": k, "out": end})), + Edit::Pull(pull) => ("path.convertPoint", json!({"subpath": pull.knot[0], "knot": pull.knot[1], "out": end})), } } @@ -313,6 +323,7 @@ impl Edit { Edit::Handle(k, h, from, independent) => edit::move_handle(&mut p, *k, *h, Point::new(from.x + d[0], from.y + d[1]), *independent), Edit::Segment(k, t) => edit::bend_segment(&mut p, *k, *t, d), Edit::Convert(k) => edit::convert_point(&mut p, *k, Some(Point::new(end[0], end[1]))), + Edit::Pull(pull) => pull.apply(&mut p), } .ok()?; Some(p) @@ -606,6 +617,9 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool let ds = &mut app.ui.direct_selection; match &mut ds.drag { Some(Drag::Edit { base, edit, start, end, preview, .. }) => { + if let Edit::Pull(pull) = edit { + pull.step([x, y], mods); + } *end = edit.constrain(*start, [x, y], mods.shift); *preview = edit.preview(base, *start, *end); } @@ -615,7 +629,10 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool true } ToolEvent::Up { x, y } => match app.ui.direct_selection.drag.take() { - Some(Drag::Edit { target, base, edit, start, .. }) => { + Some(Drag::Edit { target, base, mut edit, start, .. }) => { + if let Edit::Pull(pull) = &mut edit { + pull.step([x, y], mods); + } let end = edit.constrain(start, [x, y], mods.shift); release(app, target, &base, &edit, start, end, mods); app.ui.direct_selection.coalesce = None; @@ -828,7 +845,7 @@ pub(crate) fn moved(app: &PhotocraftApp, start: [f64; 2], end: [f64; 2]) -> bool (end[0] - start[0]).hypot(end[1] - start[1]) * f64::from(app.point_zoom()) >= 1.0 } -/// End of an edit drag: commit it as one command. A click (no movement) commits nothing, except +/// End of an edit drag: commit it as one command (or one history step). A click (no movement) commits nothing, except /// Pen + ⌥ on an anchor, which makes it a corner. The Pen path being drawn takes the edit directly. fn release(app: &mut PhotocraftApp, target: PathRef, base: &Path, edit: &Edit, start: [f64; 2], end: [f64; 2], mods: Modifiers) { let moved = moved(app, start, end); @@ -846,10 +863,10 @@ fn release(app: &mut PhotocraftApp, target: PathRef, base: &Path, edit: &Edit, s } return; } - let (id, mut params) = match edit { - Edit::Convert([s, k]) if !moved => ("path.convertPoint", json!({"subpath": s, "knot": k})), + let mut commands = match edit { + Edit::Convert([s, k]) if !moved => vec![("path.convertPoint", json!({"subpath": s, "knot": k}))], _ if !moved => return, - e => e.command(start, end), + e => e.commands(start, end), }; // The Convert Point tool names its steps as the reference does; the Pen's ⌥ and Direct // Selection (Convert Point with ⌘ too) keep the commands' own names. @@ -859,20 +876,24 @@ fn release(app: &mut PhotocraftApp, target: PathRef, base: &Path, edit: &Edit, s Edit::Handle(.., true) if convert_tool => Some("Corner Drag"), _ => None, }; - if let (Some(p), Some(name)) = (params.as_object_mut(), step_name) { - p.insert("stepName".into(), json!(name)); - } - if let (Some(p), Some(t)) = (params.as_object_mut(), target.params(app).as_object()) { - p.extend(t.clone()); - } - if let (Some(p), Some(key)) = (params.as_object_mut(), app.ui.direct_selection.coalesce.take()) { - p.insert("coalesce".into(), json!(key)); + let (target_params, key) = (target.params(app), app.ui.direct_selection.coalesce.take()); + for (_, params) in &mut commands { + if let (Some(p), Some(name)) = (params.as_object_mut(), step_name) { + p.insert("stepName".into(), json!(name)); + } + if let (Some(p), Some(t)) = (params.as_object_mut(), target_params.as_object()) { + p.extend(t.clone()); + } + // Several commands (Add Anchor Point's pull) share the key, so they make one step. + if let (Some(p), Some(key)) = (params.as_object_mut(), key.as_ref()) { + p.insert("coalesce".into(), json!(key)); + } } // sync_views checks ownership while the command runs: keep this selection off the live UI // until its own command is done, then bind it to the revision that made. let selection = std::mem::take(&mut app.ui.direct_selection); - match app.run(id, params) { - Ok(_) => keep_after_command(app, selection), + match commands.into_iter().try_for_each(|(id, params)| app.run(id, params).map(|_| ())) { + Ok(()) => keep_after_command(app, selection), Err(e) => { if selection.owner.as_ref().is_some_and(|owner| owner.valid(app)) { app.ui.direct_selection = selection; From 938ef647887f70ee758943d8a7d67de52b46548d Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 16:30:26 +0100 Subject: [PATCH 02/17] Add Anchor Point: Space over the control channel moves the pulled anchor (#12707) ui.pointer's space flag now reaches Add Anchor Point's handle drag, as it does the marquee and shape drags, so agents can drive the Space case. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/control/dispatch.rs | 2 ++ .../anchor_tools/add_anchor_drag_tests.rs | 18 ++++++++++ .../ui-egui/src/tools/anchor_tools/tests.rs | 35 +++++++++---------- 3 files changed, 37 insertions(+), 18 deletions(-) diff --git a/crates/ui-egui/src/control/dispatch.rs b/crates/ui-egui/src/control/dispatch.rs index 2aa71a6915..599badd63b 100644 --- a/crates/ui-egui/src/control/dispatch.rs +++ b/crates/ui-egui/src/control/dispatch.rs @@ -1559,6 +1559,8 @@ fn forward_pointer_event(app: &mut PhotocraftApp, g: &PointerGesture, s: Pointer if let Some(d) = app.drag.as_mut().filter(|d| crate::hold_keys::repositions(d.tool)) { d.reposition = g.space; } + // Add Anchor Point's handle drag: Space moves the new anchor (#12707). + crate::anchor_tools::set_reposition(app, g.space); // A Crop drag in the default mode turns and pans the view with the image: its // points are read as the view showed them at the press (`crop_mode`). let ev = match s.ev { diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs index 5ccf72b5dc..744f5f10ef 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs @@ -233,3 +233,21 @@ fn non_finite_pointer_positions_leave_the_drag_alone() { up(&mut app, [200.0, 560.0], Modifiers::NONE); assert_knot(&knot_at(&saved(&app), [200.0, 500.0]), [200.0, 500.0], [200.0, 560.0], [200.0, 440.0]); } + +/// The Space case driven by an agent: `ui.pointer` with `space: true` moves the anchor. +#[test] +fn an_agents_space_moves_the_anchor() { + let mut app = square(); + let ctx = egui::Context::default(); + let mut pointer = |app: &mut PhotocraftApp, params: serde_json::Value| { + let (req, _rx) = crate::control::ControlRequest::new("ui.pointer", params); + match crate::control::handle(app, &ctx, &req) { + crate::control::Outcome::Done(v) => assert_eq!(v["ok"], true, "{v}"), + _ => panic!("expected an immediate reply"), + } + }; + pointer(&mut app, json!({"events": [{"kind": "down", "x": 300, "y": 400}, {"kind": "move", "x": 340, "y": 400}]})); + pointer(&mut app, json!({"space": true, "events": [{"kind": "move", "x": 340, "y": 440}]})); + pointer(&mut app, json!({"events": [{"kind": "move", "x": 352, "y": 440}, {"kind": "up", "x": 352, "y": 440}]})); + assert_knot(&knot_at(&saved(&app), [300.0, 440.0]), [300.0, 440.0], [352.0, 440.0], [248.0, 440.0]); +} diff --git a/crates/ui-egui/src/tools/anchor_tools/tests.rs b/crates/ui-egui/src/tools/anchor_tools/tests.rs index 5200c0c785..ae8ac822b0 100644 --- a/crates/ui-egui/src/tools/anchor_tools/tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/tests.rs @@ -391,24 +391,23 @@ fn an_added_anchor_on_a_curve_is_selected_smooth_and_shows_its_handles() { /// instead, #12707: `add_anchor_drag_tests`.) #[test] fn dragging_from_an_add_moves_the_new_anchor_in_one_step() { - for tool in [Tool::Pen] { - let mut app = app(tool); - with_path(&mut app); - let (before, n) = (work(&app), steps(&app)); - let on = photocraft_vector::edit::eval(&before.subpaths[0].segments()[0], 0.5); - drag(&mut app, [on.x, on.y], [on.x + 5.0, on.y + 15.0]); - let (mut want, k) = added_at(&before, on); - photocraft_vector::edit::move_anchors(&mut want, &[k], [5.0, 15.0]).unwrap(); - assert_close(&work(&app), &want, &format!("{tool:?}: the new anchor moved with its handles")); - assert_smooth(&work(&app).subpaths[0].knots[1]); - assert_eq!(steps(&app), n + 1, "{tool:?}: one step"); - assert_eq!(app.session.active().unwrap().history.undo_label(), Some("Add Anchor Point")); - assert!(app.ui.pen.is_none(), "{tool:?}: no Pen path was started"); - assert_eq!(app.ui.direct_selection.anchors, vec![k], "{tool:?}: it stays selected"); - assert!(crate::direct_select::shows(&app, Modifiers::NONE), "{tool:?}: its handles show"); - assert!(app.session.undo()); - assert_eq!(work(&app), before, "{tool:?}: one undo takes back the add and the move"); - } + let tool = Tool::Pen; + let mut app = app(tool); + with_path(&mut app); + let (before, n) = (work(&app), steps(&app)); + let on = photocraft_vector::edit::eval(&before.subpaths[0].segments()[0], 0.5); + drag(&mut app, [on.x, on.y], [on.x + 5.0, on.y + 15.0]); + let (mut want, k) = added_at(&before, on); + photocraft_vector::edit::move_anchors(&mut want, &[k], [5.0, 15.0]).unwrap(); + assert_close(&work(&app), &want, &format!("{tool:?}: the new anchor moved with its handles")); + assert_smooth(&work(&app).subpaths[0].knots[1]); + assert_eq!(steps(&app), n + 1, "{tool:?}: one step"); + assert_eq!(app.session.active().unwrap().history.undo_label(), Some("Add Anchor Point")); + assert!(app.ui.pen.is_none(), "{tool:?}: no Pen path was started"); + assert_eq!(app.ui.direct_selection.anchors, vec![k], "{tool:?}: it stays selected"); + assert!(crate::direct_select::shows(&app, Modifiers::NONE), "{tool:?}: its handles show"); + assert!(app.session.undo()); + assert_eq!(work(&app), before, "{tool:?}: one undo takes back the add and the move"); } /// A Pen path being drawn: a corner at (40, 40), then a smooth anchor at (120, 40) dragged down, From 84338a2937c151d52ad33cca5608c07c28e5eb37 Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 16:38:02 +0100 Subject: [PATCH 03/17] Add Anchor Point drag tests: drop an unneeded mut (#12707) Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs index 744f5f10ef..cba4f3238a 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs @@ -239,7 +239,7 @@ fn non_finite_pointer_positions_leave_the_drag_alone() { fn an_agents_space_moves_the_anchor() { let mut app = square(); let ctx = egui::Context::default(); - let mut pointer = |app: &mut PhotocraftApp, params: serde_json::Value| { + let pointer = |app: &mut PhotocraftApp, params: serde_json::Value| { let (req, _rx) = crate::control::ControlRequest::new("ui.pointer", params); match crate::control::handle(app, &ctx, &req) { crate::control::Outcome::Done(v) => assert_eq!(v["ok"], true, "{v}"), From 2e5d8887363954691f16bcfc425f13e6c5faa40f Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 17:12:46 +0100 Subject: [PATCH 04/17] Add Anchor Point: keep a Space move when the pointer returns to the press (#12707) A pull whose anchor Space moved commits even when the release lands on the press point; only a real click is the plain add. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tools/anchor_tools.rs | 5 +++++ .../tools/anchor_tools/add_anchor_drag_tests.rs | 16 ++++++++++++++++ crates/ui-egui/src/tools/direct_select.rs | 3 ++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/tools/anchor_tools.rs b/crates/ui-egui/src/tools/anchor_tools.rs index 9429c3292c..40e2760604 100644 --- a/crates/ui-egui/src/tools/anchor_tools.rs +++ b/crates/ui-egui/src/tools/anchor_tools.rs @@ -437,6 +437,11 @@ impl Pull { self.last = p; } + /// Has Space moved the anchor off where the add put it? + pub(crate) fn repositioned(&self) -> bool { + self.anchor != self.from + } + /// `path` with the knot as the drag has it so far: the preview. pub(crate) fn apply(&self, path: &mut Path) -> Result<(), String> { let k = path.subpaths.get_mut(self.knot[0]).and_then(|sp| sp.knots.get_mut(self.knot[1])).ok_or("no such anchor")?; diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs index cba4f3238a..6503ee357c 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs @@ -134,6 +134,22 @@ fn space_moves_the_anchor_with_its_handles_and_letting_go_returns_to_the_handle( assert!(!crate::anchor_tools::set_reposition(&mut app, true), "no drag, nothing to reposition"); } +/// A pull whose anchor Space moved is kept when the pointer comes back to the press point before +/// the release: the release is not a click. +#[test] +fn space_moves_are_kept_when_the_pointer_returns_to_the_press() { + let mut app = square(); + down(&mut app, [300.0, 400.0]); + to(&mut app, [340.0, 400.0], Modifiers::NONE); + crate::anchor_tools::set_reposition(&mut app, true); + to(&mut app, [340.0, 440.0], Modifiers::NONE); + crate::anchor_tools::set_reposition(&mut app, false); + to(&mut app, [300.0, 400.0], Modifiers::NONE); + up(&mut app, [300.0, 400.0], Modifiers::NONE); + let k = knot_at(&saved(&app), [300.0, 440.0]); + assert_knot(&k, [300.0, 440.0], [300.0, 400.0], [300.0, 480.0]); +} + /// The Space case through the real canvas: the held key reaches the drag, and the view does not pan. #[test] fn space_in_the_canvas_moves_the_anchor_instead_of_panning() { diff --git a/crates/ui-egui/src/tools/direct_select.rs b/crates/ui-egui/src/tools/direct_select.rs index ae15462b67..b9b6066c6f 100644 --- a/crates/ui-egui/src/tools/direct_select.rs +++ b/crates/ui-egui/src/tools/direct_select.rs @@ -848,7 +848,8 @@ pub(crate) fn moved(app: &PhotocraftApp, start: [f64; 2], end: [f64; 2]) -> bool /// End of an edit drag: commit it as one command (or one history step). A click (no movement) commits nothing, except /// Pen + ⌥ on an anchor, which makes it a corner. The Pen path being drawn takes the edit directly. fn release(app: &mut PhotocraftApp, target: PathRef, base: &Path, edit: &Edit, start: [f64; 2], end: [f64; 2], mods: Modifiers) { - let moved = moved(app, start, end); + // A pull whose anchor Space moved commits even if the pointer came back to the press. + let moved = moved(app, start, end) || matches!(edit, Edit::Pull(pull) if pull.repositioned()); if target == PathRef::Pen { let edited = match edit { Edit::Convert(k) if !moved => { From cd4860aa6351b730082095dae749448d0deff399 Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 18:40:20 +0100 Subject: [PATCH 05/17] Add Anchor Point: select and edit existing anchors and handles (#12708) A press on an anchor or a shown handle of the targeted path now starts Direct Selection there: a click selects the anchor (Shift adds it), a drag moves it or the handle (a smooth anchor's other handle turns with it, Alt moves it alone). A click on empty canvas deselects the anchors and the path stays targeted. A click on a segment still adds an anchor. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tools/anchor_tools.rs | 40 +++- .../anchor_tools/add_anchor_select_tests.rs | 193 ++++++++++++++++++ .../ui-egui/src/tools/anchor_tools/tests.rs | 13 +- crates/ui-egui/src/tools/direct_select.rs | 29 ++- 4 files changed, 264 insertions(+), 11 deletions(-) create mode 100644 crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs diff --git a/crates/ui-egui/src/tools/anchor_tools.rs b/crates/ui-egui/src/tools/anchor_tools.rs index f36814934c..484dcff84f 100644 --- a/crates/ui-egui/src/tools/anchor_tools.rs +++ b/crates/ui-egui/src/tools/anchor_tools.rs @@ -7,6 +7,9 @@ //! click inserts it there (`path.addAnchor`). A curve is split without changing its shape, into //! a smooth anchor; a straight segment gets a corner. The new anchor is selected with its //! direction handles showing, and a drag from the click moves it, as in Photoshop (#8653). +//! On an anchor or a shown handle it works as Direct Selection does (#12708): a click selects +//! the anchor (⇧ adds it), a drag moves it or the handle (⌥ moves a handle alone), and a click on +//! empty canvas deselects the anchors while the path stays targeted. //! * Delete Anchor Point: hovering an anchor highlights it; a click removes it //! (`path.deleteAnchor`), joining its neighbours. //! * ⌥ swaps the two tools and ⌘/Ctrl is Direct Selection (`direct_select`) while held; ⌥-click @@ -185,6 +188,8 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool ds.owner = owner; } else if tool == Tool::DeleteAnchorPoint && start_segment_drag(app, [x, y], mods) { return true; + } else if app.ui.tool == Tool::AddAnchorPoint && edit_existing(app, [x, y], mods) { + return true; } else { click(app, tool, [x, y]); } @@ -239,6 +244,26 @@ fn start_segment_drag(app: &mut PhotocraftApp, p: [f64; 2], mods: Modifiers) -> true } +/// Add Anchor Point (#12708): a press on an anchor or a shown handle of the targeted path starts +/// Direct Selection there (`direct_select::begin`): the anchor is selected (⇧ adds it to the +/// selection) and a drag moves it (**Drag Anchor Point(s)**), or the handle (**Drag Control +/// Point**; a smooth anchor's other handle turns with it, ⌥ moves it alone). The drag's Move and Up +/// reach `direct_select::pointer` first; a click without movement records nothing. Not measured, +/// so as today: ⌥ on an anchor (Delete Anchor Point) and the Pen path being drawn. False when the +/// press is not on such an anchor or handle (a segment press goes on to add). +fn edit_existing(app: &mut PhotocraftApp, p: [f64; 2], mods: Modifiers) -> bool { + let Some((r, path, hit)) = crate::direct_select::hit_active_handles(app, p) else { return false }; + let grabs = match hit { + Hit::Handle(..) => true, + Hit::Anchor(_) => !mods.alt, + Hit::Segment(..) => false, + }; + if !grabs || r == PathRef::Pen || ignores(app, &r) { + return false; + } + crate::direct_select::begin(app, r, path, hit, p, mods, false) +} + /// ⌥-click with Delete Anchor Point on an anchor of a targeted path selects its whole subpath, as /// in Photoshop (#12770); ⌥ is Add Anchor Point only on a segment. The path and that subpath's /// anchors, or `None` when the press hits no anchor of a targeted path (a shape in a group that @@ -290,12 +315,19 @@ fn select_follower(app: &mut PhotocraftApp, r: PathRef, before: &Path, [s, k]: [ select_shown(app, r, vec![s], next.map(|k| [s, k]).into_iter().collect()); } -/// A click on empty canvas hides the saved path's anchors; its outline stays and it stays targeted (#12769). +/// A click on empty canvas: Delete Anchor Point hides the saved path's anchors (#12769), Add Anchor +/// Point deselects every anchor (#12708). The outline stays and the path stays targeted. fn hide_anchors(app: &mut PhotocraftApp, tool: Tool, p: [f64; 2]) { - if tool != Tool::DeleteAnchorPoint || crate::direct_select::hit_active(app, p).is_some() { + if crate::direct_select::hit_active(app, p).is_some() { return; } - if let Some((i, _)) = crate::vector_ui::selected_saved_path_index(app) { + if tool == Tool::AddAnchorPoint && app.ui.tool == Tool::AddAnchorPoint { + let ds = &mut app.ui.direct_selection; + ds.anchors.clear(); + ds.segment = None; + } else if tool == Tool::DeleteAnchorPoint + && let Some((i, _)) = crate::vector_ui::selected_saved_path_index(app) + { select_shown(app, PathRef::Saved(i), Vec::new(), Vec::new()); } } @@ -409,6 +441,8 @@ fn draw_hit(painter: &egui::Painter, to_scr: &dyn Fn([f64; 2]) -> Pos2, accent: #[cfg(test)] mod add_anchor_lock_tests; #[cfg(test)] +mod add_anchor_select_tests; +#[cfg(test)] mod add_anchor_targeted_path_tests; #[cfg(test)] mod delete_anchor_drag_segment_tests; diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs new file mode 100644 index 0000000000..145325130d --- /dev/null +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs @@ -0,0 +1,193 @@ +//! #12708: Add Anchor Point selects, moves and reshapes existing anchors and handles as Direct +//! Selection does, and a click on a segment still adds an anchor. + +use egui::Modifiers; +use photocraft_doc::vector::Path; +use photocraft_geom::Point; +use photocraft_vector::edit::{Handle, Hit}; +use serde_json::json; + +use super::delete_anchor_targeted_path_tests::{setup, steps}; +use crate::PhotocraftApp; +use crate::canvas::{ToolEvent, tool_event}; +use crate::direct_select::PathRef; +use crate::state::Tool; + +/// Saved path "Path 1", targeted in the Paths panel: the closed corner square of the issue and an +/// open curve through the measured smooth anchor (549.5,340), in (474.7,340), out (624.7,340). +fn target_path_1(app: &mut PhotocraftApp) { + let path = json!({"subpaths": [ + {"closed": true, "knots": [[100, 300], [300, 300], [300, 500], [100, 500]]}, + {"closed": false, "knots": [ + [450, 450], + {"anchor": [549.5, 340], "in": [474.7, 340], "out": [624.7, 340], "smooth": true}, + [650, 450]]}, + ]}); + app.run("path.set", json!({"name": "Path 1", "path": path})).unwrap(); + app.ui.selected_path = Some("Path 1".into()); +} + +fn tool_app(tool: Tool) -> PhotocraftApp { + let (mut app, _) = setup(tool); + target_path_1(&mut app); + app +} + +fn path(app: &PhotocraftApp) -> Path { + app.session.active().unwrap().doc.paths[0].path.clone() +} + +fn knot(app: &PhotocraftApp, s: usize, k: usize) -> photocraft_doc::Knot { + path(app).subpaths[s].knots[k].clone() +} + +fn label(app: &PhotocraftApp) -> Option { + app.session.active().unwrap().history.undo_label().map(str::to_string) +} + +fn click(app: &mut PhotocraftApp, at: [f64; 2], mods: Modifiers) { + drag(app, at, at, mods); +} + +fn drag(app: &mut PhotocraftApp, from: [f64; 2], to: [f64; 2], mods: Modifiers) { + tool_event(app, ToolEvent::Down { x: from[0], y: from[1], pressure: 1.0 }, mods); + tool_event(app, ToolEvent::Move { x: to[0], y: to[1], pressure: 1.0 }, mods); + tool_event(app, ToolEvent::Up { x: to[0], y: to[1] }, mods); +} + +/// The History step Direct Selection records for the same gesture: Add Anchor Point names its +/// anchor and handle drags as Direct Selection does. +fn direct_selection_label(gesture: impl Fn(&mut PhotocraftApp)) -> Option { + let mut app = tool_app(Tool::DirectSelection); + gesture(&mut app); + label(&app) +} + +fn close(got: Point, want: [f64; 2], what: &str) { + assert!((got.x - want[0]).abs() <= 0.5 && (got.y - want[1]).abs() <= 0.5, "{what}: got ({}, {}), want {want:?}", got.x, got.y); +} + +#[test] +fn after_a_click_on_a_segment_the_new_anchor_is_the_only_selected_one_and_its_handles_show() { + let mut app = tool_app(Tool::AddAnchorPoint); + click(&mut app, [100.0, 300.0], Modifiers::NONE); + assert_eq!(app.ui.direct_selection.anchors, vec![[0, 0]]); + let n = steps(&app); + // The curve's first segment, (450,450) to the smooth anchor. + let on_curve = photocraft_vector::edit::eval(&path(&app).subpaths[1].segments()[0], 0.5); + click(&mut app, [on_curve.x, on_curve.y], Modifiers::NONE); + assert_eq!(steps(&app), n + 1); + assert_eq!(label(&app).as_deref(), Some("Add Anchor Point")); + assert_eq!(app.ui.direct_selection.target, Some(PathRef::Saved(0))); + assert_eq!(app.ui.direct_selection.anchors, vec![[1, 1]], "the new anchor is the only selected one"); + let added = knot(&app, 1, 1); + let out = [added.out_ctrl.x, added.out_ctrl.y]; + assert_ne!(added.out_ctrl, added.anchor, "a curve split gives the anchor handles"); + assert_eq!(crate::direct_select::hit_active_handles(&app, out).map(|h| h.2), Some(Hit::Handle([1, 1], Handle::Out)), "its handles are shown"); +} + +#[test] +fn a_click_on_an_anchor_selects_it_shift_adds_and_empty_canvas_deselects_without_steps() { + let mut app = tool_app(Tool::AddAnchorPoint); + let (before, n) = (path(&app), steps(&app)); + click(&mut app, [300.0, 300.0], Modifiers::NONE); + assert_eq!(app.ui.direct_selection.target, Some(PathRef::Saved(0))); + assert_eq!(app.ui.direct_selection.anchors, vec![[0, 1]]); + click(&mut app, [300.0, 500.0], Modifiers::SHIFT); + assert_eq!(app.ui.direct_selection.anchors, vec![[0, 1], [0, 2]]); + click(&mut app, [100.0, 300.0], Modifiers::NONE); + assert_eq!(app.ui.direct_selection.anchors, vec![[0, 0]], "a plain click selects that anchor alone"); + click(&mut app, [50.0, 50.0], Modifiers::NONE); + assert!(app.ui.direct_selection.anchors.is_empty()); + assert_eq!(app.ui.selected_path.as_deref(), Some("Path 1"), "the path stays targeted"); + assert_eq!((path(&app), steps(&app)), (before, n), "selecting changes nothing and records nothing"); +} + +#[test] +fn dragging_an_anchor_moves_it_with_its_handles_in_one_step() { + let gesture = |app: &mut PhotocraftApp| drag(app, [300.0, 300.0], [330.0, 280.0], Modifiers::NONE); + let mut app = tool_app(Tool::AddAnchorPoint); + let n = steps(&app); + gesture(&mut app); + let k = knot(&app, 0, 1); + assert_eq!((k.anchor, k.in_ctrl, k.out_ctrl), (Point::new(330.0, 280.0), Point::new(330.0, 280.0), Point::new(330.0, 280.0))); + assert_eq!(path(&app).subpaths[0].knots.len(), 4, "no anchor added"); + assert_eq!(steps(&app), n + 1); + let name = label(&app); + assert!(matches!(name.as_deref(), Some("Drag Anchor Point" | "Drag Anchor Points")), "{name:?}"); + assert_eq!(name, direct_selection_label(gesture)); + assert_eq!(app.ui.direct_selection.anchors, vec![[0, 1]], "the dragged anchor stays selected"); +} + +#[test] +fn dragging_a_smooth_anchors_out_handle_turns_the_in_handle_and_keeps_its_length() { + let gesture = |app: &mut PhotocraftApp| { + click(app, [549.5, 340.0], Modifiers::NONE); + drag(app, [624.7, 340.0], [624.7, 300.0], Modifiers::NONE); + }; + let mut app = tool_app(Tool::AddAnchorPoint); + let n = steps(&app); + gesture(&mut app); + let k = knot(&app, 1, 1); + close(k.anchor, [549.5, 340.0], "anchor"); + close(k.out_ctrl, [624.7, 300.0], "out"); + close(k.in_ctrl, [483.4, 375.2], "in"); + assert_eq!(steps(&app), n + 1, "the selecting click records nothing, the drag one step"); + let name = label(&app); + assert!(matches!(name.as_deref(), Some("Drag Control Point" | "Drag Direction Point")), "{name:?}"); + assert_eq!(name, direct_selection_label(gesture)); +} + +#[test] +fn alt_dragging_a_handle_moves_only_that_handle() { + let gesture = |app: &mut PhotocraftApp| { + click(app, [549.5, 340.0], Modifiers::NONE); + drag(app, [474.7, 340.0], [474.7, 300.0], Modifiers::ALT); + }; + let mut app = tool_app(Tool::AddAnchorPoint); + let n = steps(&app); + gesture(&mut app); + let k = knot(&app, 1, 1); + close(k.in_ctrl, [474.7, 300.0], "in"); + close(k.out_ctrl, [624.7, 340.0], "out unchanged"); + close(k.anchor, [549.5, 340.0], "anchor"); + assert_eq!(path(&app).subpaths[1].knots.len(), 3, "⌥ on a handle neither adds nor deletes"); + assert_eq!(steps(&app), n + 1); + let name = label(&app); + assert!(matches!(name.as_deref(), Some("Drag Control Point" | "Drag Direction Point")), "{name:?}"); + assert_eq!(name, direct_selection_label(gesture)); +} + +#[test] +fn a_click_on_a_segment_still_adds_an_anchor_with_no_anchor_selected() { + let mut app = tool_app(Tool::AddAnchorPoint); + click(&mut app, [300.0, 300.0], Modifiers::NONE); + click(&mut app, [50.0, 50.0], Modifiers::NONE); + assert!(app.ui.direct_selection.anchors.is_empty()); + let n = steps(&app); + click(&mut app, [200.0, 300.0], Modifiers::NONE); + assert_eq!(path(&app).subpaths[0].knots.len(), 5); + assert_eq!(steps(&app), n + 1); + assert_eq!(label(&app).as_deref(), Some("Add Anchor Point")); +} + +/// Not measured, so as today: ⌥-click on an anchor with Add Anchor Point is Delete Anchor Point. +#[test] +fn alt_click_on_an_anchor_still_deletes_it() { + let mut app = tool_app(Tool::AddAnchorPoint); + let n = steps(&app); + click(&mut app, [300.0, 300.0], Modifiers::ALT); + assert_eq!(path(&app).subpaths[0].knots.len(), 3); + assert_eq!(steps(&app), n + 1); + assert_eq!(label(&app).as_deref(), Some("Delete Anchor Point")); +} + +/// A press on a handle that is not shown (its anchor is not selected) grabs nothing: the press +/// falls through to the segment test, and off every segment it only deselects. +#[test] +fn a_hidden_handle_is_not_grabbed() { + let mut app = tool_app(Tool::AddAnchorPoint); + let (before, n) = (path(&app), steps(&app)); + drag(&mut app, [624.7, 340.0], [624.7, 300.0], Modifiers::NONE); + assert_eq!((path(&app), steps(&app)), (before, n)); +} diff --git a/crates/ui-egui/src/tools/anchor_tools/tests.rs b/crates/ui-egui/src/tools/anchor_tools/tests.rs index ae58b9b611..a4d5df0089 100644 --- a/crates/ui-egui/src/tools/anchor_tools/tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/tests.rs @@ -451,14 +451,19 @@ fn the_pen_adds_a_smooth_anchor_to_a_curve_being_drawn_and_drags_it() { } /// A press a couple of pixels off an existing anchor hits the anchor (anchors win the hit test), so -/// Add Anchor Point adds nothing there, and a drag from it moves nothing and leaves no selection. +/// Add Anchor Point adds nothing there; a drag from it moves that anchor, as Direct Selection does +/// (#12708). #[test] -fn a_drag_near_an_existing_anchor_adds_and_moves_nothing() { +fn a_drag_near_an_existing_anchor_moves_it_and_adds_nothing() { let mut app = app(Tool::AddAnchorPoint); with_path(&mut app); let (before, n) = (work(&app), steps(&app)); assert!(matches!(photocraft_vector::edit::hit(&before, Point::new(42.0, 41.0), 6.0, &[]), Some(photocraft_vector::edit::Hit::Anchor([0, 0])))); drag(&mut app, [42.0, 41.0], [60.0, 70.0]); - assert_eq!((work(&app), steps(&app)), (before, n)); - assert!(app.ui.direct_selection.anchors.is_empty() && app.ui.direct_selection.drag.is_none()); + let after = work(&app); + assert_eq!(after.subpaths[0].knots.len(), before.subpaths[0].knots.len()); + assert_eq!(after.subpaths[0].knots[0].anchor, Point::new(58.0, 69.0)); + assert_eq!(steps(&app), n + 1); + assert_eq!(app.ui.direct_selection.anchors, vec![[0, 0]]); + assert!(app.ui.direct_selection.drag.is_none()); } diff --git a/crates/ui-egui/src/tools/direct_select.rs b/crates/ui-egui/src/tools/direct_select.rs index 3ee51b3862..87a77f968b 100644 --- a/crates/ui-egui/src/tools/direct_select.rs +++ b/crates/ui-egui/src/tools/direct_select.rs @@ -458,8 +458,20 @@ pub(crate) fn hit_target(app: &PhotocraftApp, p: [f64; 2], handles: bool) -> Opt /// (#12762, #12705). Not measured, so as today: a layer inside a hidden group, and a shown shape layer /// inside a group, which stays a target without being active. pub(crate) fn hit_active(app: &PhotocraftApp, p: [f64; 2]) -> Option<(PathRef, Path, Hit)> { + hit_targeted(app, p, false) +} + +/// [`hit_active`] where the handles shown on a selection still valid count too: what an Add Anchor +/// Point press grabs (#12708). +pub(crate) fn hit_active_handles(app: &PhotocraftApp, p: [f64; 2]) -> Option<(PathRef, Path, Hit)> { + hit_targeted(app, p, true) +} + +fn hit_targeted(app: &PhotocraftApp, p: [f64; 2], handles: bool) -> Option<(PathRef, Path, Hit)> { let tol = 6.0 / f64::from(app.point_zoom().max(0.01)); let st = app.session.active()?; + let ds = &app.ui.direct_selection; + let valid = handles && still_valid(app, ds); // A path selected in the Paths panel (saved or Work Path) is the only target; otherwise `targeted`. let targets: Vec<(PathRef, Path)> = match crate::vector_ui::selected_saved_path_index(app) { Some((i, path)) => Some((PathRef::Saved(i), path)).filter(|(r, _)| writable(app, r)).into_iter().collect(), @@ -467,10 +479,12 @@ pub(crate) fn hit_active(app: &PhotocraftApp, p: [f64; 2]) -> Option<(PathRef, P None if app.ui.selected_path.as_deref() == Some("work") => active_paths(app).into_iter().filter(|(r, _)| *r == PathRef::Work).collect(), None => targeted(app), }; - targets - .into_iter() - .filter(|(r, _)| !matches!(r, PathRef::Layer(id) if !st.doc.layer(photocraft_doc::LayerId(*id)).is_some_and(|l| l.visible))) - .find_map(|(r, path)| edit::hit(&path, Point::new(p[0], p[1]), tol, &[]).map(|h| (r, path, h))) + targets.into_iter().filter(|(r, _)| !matches!(r, PathRef::Layer(id) if !st.doc.layer(photocraft_doc::LayerId(*id)).is_some_and(|l| l.visible))).find_map( + |(r, path)| { + let shown = if valid && ds.target.as_ref() == Some(&r) { shown_handles(ds, &path) } else { Vec::new() }; + edit::hit(&path, Point::new(p[0], p[1]), tol, &shown).map(|h| (r, path, h)) + }, + ) } /// The Pen draft (as `candidates` builds it), then the active paths, then (not measured, so as today, @@ -651,6 +665,13 @@ fn press(app: &mut PhotocraftApp, p: [f64; 2], mods: Modifiers, convert: bool) - ds.owner = owner; return true; }; + begin(app, target, base, hit, p, mods, convert) +} + +/// Select what a press at `p` hit on `target` (`base` its path) and start dragging it. Add Anchor +/// Point starts here too for an anchor or a shown handle (#12708). +pub(crate) fn begin(app: &mut PhotocraftApp, target: PathRef, base: Path, hit: Hit, p: [f64; 2], mods: Modifiers, convert: bool) -> bool { + let own_tool = app.ui.tool == Tool::ConvertPoint; if let PathRef::Layer(id) | PathRef::TypePath(id) = target && app.session.active().and_then(|st| st.active_layer).map(|l| l.0) != Some(id) { From 382df0fb1442cb399ce959221a11f4238c4392e3 Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 18:56:07 +0100 Subject: [PATCH 06/17] Add Anchor Point: merge the press branches and drop a needless clone (clippy) Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tools/anchor_tools.rs | 6 +++--- .../src/tools/anchor_tools/add_anchor_select_tests.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/ui-egui/src/tools/anchor_tools.rs b/crates/ui-egui/src/tools/anchor_tools.rs index 484dcff84f..31a7dcef5b 100644 --- a/crates/ui-egui/src/tools/anchor_tools.rs +++ b/crates/ui-egui/src/tools/anchor_tools.rs @@ -186,9 +186,9 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool ds.subpath_press = Some([x, y]); // A stale press is dropped with the selection (`cancel_stale`). ds.owner = owner; - } else if tool == Tool::DeleteAnchorPoint && start_segment_drag(app, [x, y], mods) { - return true; - } else if app.ui.tool == Tool::AddAnchorPoint && edit_existing(app, [x, y], mods) { + } else if (tool == Tool::DeleteAnchorPoint && start_segment_drag(app, [x, y], mods)) + || (app.ui.tool == Tool::AddAnchorPoint && edit_existing(app, [x, y], mods)) + { return true; } else { click(app, tool, [x, y]); diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs index 145325130d..c01a3d2472 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs @@ -38,7 +38,7 @@ fn path(app: &PhotocraftApp) -> Path { } fn knot(app: &PhotocraftApp, s: usize, k: usize) -> photocraft_doc::Knot { - path(app).subpaths[s].knots[k].clone() + path(app).subpaths[s].knots[k] } fn label(app: &PhotocraftApp) -> Option { From 8c3898eed4b32d23d6db61017bbba7317dae3db2 Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 19:08:24 +0100 Subject: [PATCH 07/17] Add Anchor Point: a shown handle wins over the Alt segment drag With Alt held the press is Delete Anchor Point, whose straight-segment drag ran first and bent a segment lying under a shown handle. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/tools/anchor_tools.rs | 5 ++-- .../anchor_tools/add_anchor_select_tests.rs | 23 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/tools/anchor_tools.rs b/crates/ui-egui/src/tools/anchor_tools.rs index 31a7dcef5b..ea13c3934b 100644 --- a/crates/ui-egui/src/tools/anchor_tools.rs +++ b/crates/ui-egui/src/tools/anchor_tools.rs @@ -186,8 +186,9 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool ds.subpath_press = Some([x, y]); // A stale press is dropped with the selection (`cancel_stale`). ds.owner = owner; - } else if (tool == Tool::DeleteAnchorPoint && start_segment_drag(app, [x, y], mods)) - || (app.ui.tool == Tool::AddAnchorPoint && edit_existing(app, [x, y], mods)) + } else if (app.ui.tool == Tool::AddAnchorPoint && edit_existing(app, [x, y], mods)) + // After the shown handles: ⌥ makes `tool` Delete, and a handle over a segment is the handle. + || (tool == Tool::DeleteAnchorPoint && start_segment_drag(app, [x, y], mods)) { return true; } else { diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs index c01a3d2472..70cf7e195d 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs @@ -191,3 +191,26 @@ fn a_hidden_handle_is_not_grabbed() { drag(&mut app, [624.7, 340.0], [624.7, 300.0], Modifiers::NONE); assert_eq!((path(&app), steps(&app)), (before, n)); } + +/// ⌥-drag on a shown handle that lies on a straight segment moves the handle alone; the segment +/// under it is not bent (⌥ makes the press Delete Anchor Point, whose segment drag must not win). +#[test] +fn alt_drag_on_a_shown_handle_over_a_straight_segment_moves_the_handle() { + let (mut app, _) = setup(Tool::AddAnchorPoint); + let doc_path = json!({"subpaths": [ + {"closed": true, "knots": [[100, 300], [300, 300], [300, 500], [100, 500]]}, + {"closed": false, "knots": [ + [100, 200], + {"anchor": [200, 250], "in": [150, 250], "out": [200, 300], "smooth": false}, + [300, 200]]}, + ]}); + app.run("path.set", json!({"name": "Path 1", "path": doc_path})).unwrap(); + app.ui.selected_path = Some("Path 1".into()); + click(&mut app, [200.0, 250.0], Modifiers::NONE); + let (square, n) = (path(&app).subpaths[0].clone(), steps(&app)); + drag(&mut app, [200.0, 300.0], [220.0, 330.0], Modifiers::ALT); + assert_eq!(path(&app).subpaths[0], square, "the square's top edge is not bent"); + assert_eq!(knot(&app, 1, 1).out_ctrl, Point::new(220.0, 330.0)); + assert_eq!(knot(&app, 1, 1).in_ctrl, Point::new(150.0, 250.0)); + assert_eq!(steps(&app), n + 1); +} From 0abf9689b0a36f673356e2bf68390819b29cabf6 Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 20:11:17 +0100 Subject: [PATCH 08/17] WIP: Add Anchor Point: Alt selects or duplicates the whole subpath (#12709) From 14e41c50b25807b9ea10a3a7676f3b37d0c04dc3 Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 20:29:26 +0100 Subject: [PATCH 09/17] Add Anchor Point: Alt selects or duplicates the whole subpath (#12709) Alt no longer turns Add Anchor Point into Delete Anchor Point. Alt+click on a segment of the targeted path selects that whole subpath with no History step; Alt+drag copies the subpath and moves the copy, one step "Drag Path", leaving the copy selected. Alt+click on an anchor deletes nothing. The cursor with Alt held is the arrow with "+" everywhere. path.moveAnchors gains "duplicate": the subpaths holding the anchors are copied to the end of the path and the copies move (vector edit::duplicate_subpaths, shared by the canvas preview). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/path_edit_cmds.rs | 15 +- crates/ui-egui/src/canvas.rs | 7 +- .../tool_cursor/add_anchor_cursor_tests.rs | 8 +- crates/ui-egui/src/canvas/tool_feedback.rs | 7 +- crates/ui-egui/src/tools/anchor_tools.rs | 38 ++++- .../anchor_tools/add_anchor_alt_tests.rs | 143 ++++++++++++++++++ .../ui-egui/src/tools/anchor_tools/tests.rs | 10 +- crates/ui-egui/src/tools/direct_select.rs | 17 ++- crates/vector/src/edit.rs | 46 +++++- 9 files changed, 266 insertions(+), 25 deletions(-) create mode 100644 crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs diff --git a/crates/engine/src/cmd/path_edit_cmds.rs b/crates/engine/src/cmd/path_edit_cmds.rs index 1312347662..f06d42ae3e 100644 --- a/crates/engine/src/cmd/path_edit_cmds.rs +++ b/crates/engine/src/cmd/path_edit_cmds.rs @@ -117,7 +117,15 @@ fn move_anchors(s: &mut Session, p: &Value) -> Result { .collect::>()?; let d = offset(CMD, p)?; let label = step_name(CMD, p, "Drag Anchor Points", "Drag Path")?; - if p.get("curvature").and_then(Value::as_bool).unwrap_or(false) { + let curvature = p.get("curvature").and_then(Value::as_bool).unwrap_or(false); + let duplicate = p.get("duplicate").map(|v| v.as_bool().ok_or_else(|| bad(CMD, "`duplicate` must be true or false"))).transpose()?.unwrap_or(false); + if duplicate { + if curvature { + return Err(bad(CMD, "`duplicate` and `curvature` can't be combined")); + } + return edit_path(s, CMD, p, label, |path| edit::duplicate_subpaths(path, &anchors, d).map(|_| ())); + } + if curvature { return edit_path(s, CMD, p, label, |path| edit::move_anchors_curvature(path, &anchors, d)); } edit_path(s, CMD, p, label, |path| edit::move_anchors(path, &anchors, d)) @@ -284,7 +292,7 @@ pub fn specs() -> Vec { journal: true, }; vec![ - spec("path.moveAnchors", "Drag Anchor Points", r#""anchors":[[subpath,knot],…],"move":[dx,dy],"curvature":bool=false (anchors move with their handles; Direct Selection drag. curvature = the Curvature Pen's drag: every smooth knot of the touched subpaths gets its handles recomputed so the curve flows through the anchors),"stepName":"Drag Path"? (History step name; the Convert Point tool sends it when it drags a whole path; default "Drag Anchor Points"; any other value is refused)"#.into(), move_anchors), + spec("path.moveAnchors", "Drag Anchor Points", r#""anchors":[[subpath,knot],…],"move":[dx,dy],"curvature":bool=false (anchors move with their handles; Direct Selection drag. curvature = the Curvature Pen's drag: every smooth knot of the touched subpaths gets its handles recomputed so the curve flows through the anchors),"duplicate":bool=false (Add Anchor Point's ⌥-drag: the subpaths holding the anchors are copied to the end of the path and the copies move; the originals stay; not with curvature),"stepName":"Drag Path"? (History step name; the Convert Point tool sends it when it drags a whole path, Add Anchor Point when it duplicates one; default "Drag Anchor Points"; any other value is refused)"#.into(), move_anchors), spec( "path.moveHandle", "Drag Direction Point", @@ -766,6 +774,9 @@ mod tests { ("path.moveAnchors", json!({"anchors": [[0]], "move": [1, 1]})), ("path.moveAnchors", json!({"anchors": [[0, 0]], "move": [1e300, 1]})), ("path.moveAnchors", json!({"anchors": [[0, 0]]})), + ("path.moveAnchors", json!({"anchors": [[0, 0]], "move": [1, 1], "duplicate": "yes"})), + ("path.moveAnchors", json!({"anchors": [[0, 0]], "move": [1, 1], "duplicate": true, "curvature": true})), + ("path.moveAnchors", json!({"anchors": [[1, 0]], "move": [1, 1], "duplicate": true})), ("path.moveHandle", json!({"subpath": 0, "knot": 0, "handle": "up", "to": [1, 1]})), ("path.moveHandle", json!({"subpath": 0, "knot": 0, "handle": "in"})), ("path.moveHandle", json!({"subpath": -1, "knot": 0, "handle": "in", "to": [1, 1]})), diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index d4ce67ba24..3ef790b6f8 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1958,14 +1958,15 @@ fn pencil_outline_cursor(painter: &egui::Painter, xf: &ViewXform, p: Pos2, size: /// A pen tool's cursor at screen point `p` (document point `doc`): the crosshair for precise Other /// Cursors (#4639), the black arrow for Add Anchor Point unless a click would split a segment -/// (#12729; ⌘ is Direct Selection's arrow, ⌥ keeps the pen), else the tool's own pen icon. +/// (#12729; ⌘ is Direct Selection's arrow, ⌥ the arrow with "+" everywhere, #12709), else the +/// tool's own pen icon. fn pen_tool_cursor(app: &PhotocraftApp, ui: &egui::Ui, tool: Tool, doc: [f64; 2], p: Pos2) -> egui::CursorIcon { if precise_other_cursor(app) { return egui::CursorIcon::Crosshair; } if tool == Tool::AddAnchorPoint { let mods = crate::workspace_ui::sticky_mods(app, ui.input(|i| i.modifiers)); - if !mods.alt && (mods.command || !crate::anchor_tools::adds_anchor_at(app, tool, doc)) { + if mods.alt || mods.command || !crate::anchor_tools::adds_anchor_at(app, tool, doc) { return crate::tool_cursor::arrow(ui.ctx(), p); } } @@ -2109,7 +2110,7 @@ fn draw_default_tool_cursor(app: &mut PhotocraftApp, ui: &mut egui::Ui, input: & crate::tool_cursor::continue_path(painter, p) } // Add Anchor Point: the pen with "+" only over a segment a click would split, else the - // black arrow (#12729); ⌘ is Direct Selection's arrow. ⌥ and Precise stay as they were. + // black arrow (#12729); ⌘ is Direct Selection's arrow, ⌥ the arrow with "+" (#12709). // The pen tools: their own icon with its nib on the point, or the crosshair for // precise Other Cursors (#4639); Add Anchor Point the black arrow off a segment (#12729). Tool::Pen | Tool::FreeformPen | Tool::CurvaturePen | Tool::AddAnchorPoint | Tool::DeleteAnchorPoint | Tool::ConvertPoint => { diff --git a/crates/ui-egui/src/canvas/tool_cursor/add_anchor_cursor_tests.rs b/crates/ui-egui/src/canvas/tool_cursor/add_anchor_cursor_tests.rs index 27b746d7c8..f09e63b6b2 100644 --- a/crates/ui-egui/src/canvas/tool_cursor/add_anchor_cursor_tests.rs +++ b/crates/ui-egui/src/canvas/tool_cursor/add_anchor_cursor_tests.rs @@ -1,7 +1,7 @@ //! #12729: Add Anchor Point's cursor says what a click would do. Over a segment of the targeted path //! it is the pen with "+"; over an anchor, a handle end, empty canvas, with no path targeted and //! over a locked shape layer's segments it is the black arrow. ⌘ keeps Direct Selection's arrow, -//! ⌥ and the Precise "Other Cursors" crosshair stay as they were. The tests drive the real canvas +//! ⌥ is the arrow (with "+", #12709) everywhere, and the Precise "Other Cursors" crosshair stays. The tests drive the real canvas //! (`document_area`) and compare the OS cursor bitmap it hands the platform with the arrow's and //! the pen's. @@ -130,8 +130,10 @@ fn with_ctrl_held_it_is_the_black_arrow_even_over_a_segment() { } #[test] -fn with_alt_held_it_stays_the_pen_over_empty_canvas() { - assert_eq!(on_path_one(SQUARE_MIDDLE, Modifiers::ALT), Shown::Pen); +fn with_alt_held_it_is_the_arrow_everywhere() { + // #12709: the reference shows the arrow with "+" over empty canvas and over a segment alike. + assert_eq!(on_path_one(SQUARE_MIDDLE, Modifiers::ALT), Shown::Arrow); + assert_eq!(on_path_one(SQUARE_TOP, Modifiers::ALT), Shown::Arrow); } #[test] diff --git a/crates/ui-egui/src/canvas/tool_feedback.rs b/crates/ui-egui/src/canvas/tool_feedback.rs index d25f587c0d..18ce6fc7f6 100644 --- a/crates/ui-egui/src/canvas/tool_feedback.rs +++ b/crates/ui-egui/src/canvas/tool_feedback.rs @@ -99,10 +99,11 @@ pub fn document_selection_mode(app: &PhotocraftApp, tool: Tool, m: egui::Modifie /// the anchor point tools show theirs). pub fn badge(app: &PhotocraftApp, tool: Tool, m: egui::Modifiers) -> Option { // Add / Delete Anchor Point: + or − beside the crosshair, as on Photoshop's pen cursors (⌥ - // swaps them; ⌘ is Direct Selection, which shows none). + // turns Delete into Add and gives Add its "+" everywhere, #12709; ⌘ is Direct Selection, + // which shows none). if let Some(t) = crate::anchor_tools::effective(tool, m) { - // Add Anchor Point shows its "+" only over a segment a click would split (#12729); ⌥'s - // swapped tools keep theirs everywhere. + // Add Anchor Point shows its "+" only over a segment a click would split (#12729); with ⌥ + // both tools show theirs everywhere. let over_segment = || app.hover_doc.is_some_and(|p| crate::anchor_tools::adds_anchor_at(app, tool, p)); return (!m.command && (m.alt || tool != Tool::AddAnchorPoint || over_segment())).then_some(if t == Tool::AddAnchorPoint { Badge::Add diff --git a/crates/ui-egui/src/tools/anchor_tools.rs b/crates/ui-egui/src/tools/anchor_tools.rs index f36814934c..08e5afb8a4 100644 --- a/crates/ui-egui/src/tools/anchor_tools.rs +++ b/crates/ui-egui/src/tools/anchor_tools.rs @@ -9,8 +9,10 @@ //! direction handles showing, and a drag from the click moves it, as in Photoshop (#8653). //! * Delete Anchor Point: hovering an anchor highlights it; a click removes it //! (`path.deleteAnchor`), joining its neighbours. -//! * ⌥ swaps the two tools and ⌘/Ctrl is Direct Selection (`direct_select`) while held; ⌥-click -//! with Delete Anchor Point on an anchor selects its whole subpath instead. +//! * ⌘/Ctrl is Direct Selection (`direct_select`) while held. ⌥ with Add Anchor Point works on a +//! whole subpath (#12709): a click on a segment selects the subpath, a drag copies it and moves +//! the copy; it adds and deletes nothing. ⌥ turns Delete Anchor Point into Add Anchor Point, +//! and its ⌥-click on an anchor selects the whole subpath instead. //! * The Pen does both with Auto Add/Delete on (its options bar, on by default, #4144): a click on //! a segment adds, a click on an anchor deletes, except an open subpath's end points; ⇧ turns it //! off while held. It edits the active path, or while a path is being drawn that path (#6140), @@ -30,11 +32,12 @@ use crate::canvas::ToolEvent; use crate::direct_select::{DirectSelection, Owner, PathRef}; use crate::state::Tool; -/// The anchor tool in effect, if the current tool is one: ⌥ swaps Add and Delete. +/// The anchor tool in effect, if the current tool is one: ⌥ turns Delete into Add. Add stays Add, +/// as in the reference (#12709): its ⌥ selects or copies a whole subpath (`alt_press`). pub fn effective(tool: Tool, mods: Modifiers) -> Option { let (add, delete) = (Tool::AddAnchorPoint, Tool::DeleteAnchorPoint); match tool { - Tool::AddAnchorPoint => Some(if mods.alt { delete } else { add }), + Tool::AddAnchorPoint => Some(add), Tool::DeleteAnchorPoint => Some(if mods.alt { add } else { delete }), _ => None, } @@ -177,7 +180,9 @@ pub fn pointer(app: &mut PhotocraftApp, ev: ToolEvent, mods: Modifiers) -> bool match ev { ToolEvent::Down { x, y, .. } => { app.ui.direct_selection.subpath_press = None; - if app.ui.tool == Tool::DeleteAnchorPoint && mods.alt && subpath_at(app, [x, y]).is_some() { + if app.ui.tool == Tool::AddAnchorPoint && mods.alt { + alt_press(app, [x, y]); + } else if app.ui.tool == Tool::DeleteAnchorPoint && mods.alt && subpath_at(app, [x, y]).is_some() { let owner = Owner::current(app); let ds = &mut app.ui.direct_selection; ds.subpath_press = Some([x, y]); @@ -239,6 +244,24 @@ fn start_segment_drag(app: &mut PhotocraftApp, p: [f64; 2], mods: Modifiers) -> true } +/// ⌥-press with Add Anchor Point (#12709), as in the reference: on a segment of the targeted path +/// it selects that whole subpath, with no History step, and a drag copies the subpath and moves +/// the copy (Direct Selection's drag, `Edit::Duplicate`, one step **Drag Path**); the drag's Move +/// and Up reach `direct_select::pointer` first. It never adds or deletes an anchor: a press on an +/// anchor, or off the path, does nothing (not measured further). The Pen path being drawn is left alone. +fn alt_press(app: &mut PhotocraftApp, p: [f64; 2]) { + use crate::direct_select::{Drag, Edit}; + let Some((r, path, Hit::Segment([s, _], _))) = target(app, Tool::AddAnchorPoint, p) else { return }; + if r == PathRef::Pen { + return; + } + let anchors = edit::subpath_anchors(&path, s); + let owner = Owner::current(app); + let ds = &mut app.ui.direct_selection; + *ds = DirectSelection { target: Some(r), anchors: anchors.clone(), owner, ..Default::default() }; + ds.drag = Some(Drag::Edit { target: r, base: path, edit: Edit::Duplicate(anchors), start: p, end: p, preview: None }); +} + /// ⌥-click with Delete Anchor Point on an anchor of a targeted path selects its whole subpath, as /// in Photoshop (#12770); ⌥ is Add Anchor Point only on a segment. The path and that subpath's /// anchors, or `None` when the press hits no anchor of a targeted path (a shape in a group that @@ -372,7 +395,8 @@ fn apply(app: &mut PhotocraftApp, r: PathRef, hit: Hit, p: [f64; 2]) -> bool { /// pointer and shows the anchor a click would add; Delete highlights the anchor it would remove. pub fn draw_hover(app: &PhotocraftApp, painter: &egui::Painter, to_scr: &dyn Fn([f64; 2]) -> Pos2, accent: Color32, mods: Modifiers) { let (Some(tool), Some(p)) = (effective(app.ui.tool, mods), app.hover_doc) else { return }; - if mods.command { + // ⌥ with Add Anchor Point adds no anchor (#12709), so it shows none. + if mods.command || (app.ui.tool == Tool::AddAnchorPoint && mods.alt) { return; } let Some((_, path, hit)) = target(app, tool, p) else { return }; @@ -406,6 +430,8 @@ fn draw_hit(painter: &egui::Painter, to_scr: &dyn Fn([f64; 2]) -> Pos2, accent: } } +#[cfg(test)] +mod add_anchor_alt_tests; #[cfg(test)] mod add_anchor_lock_tests; #[cfg(test)] diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs new file mode 100644 index 0000000000..4f29cb6d63 --- /dev/null +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs @@ -0,0 +1,143 @@ +//! #12709: ⌥ with Add Anchor Point works on a whole subpath, as in the reference application. An +//! ⌥-click on a segment selects the subpath and records nothing; an ⌥-drag on a segment copies the +//! subpath and moves the copy (one step, Drag Path). ⌥ never turns the tool into Delete Anchor Point. + +use egui::Modifiers; +use photocraft_doc::vector::Path; +use photocraft_geom::Point; +use serde_json::json; + +use super::add_anchor_lock_tests::click_with_modifiers; +use super::delete_anchor_targeted_path_tests::{select_layer, setup, shape_path, steps}; +use crate::PhotocraftApp; +use crate::canvas::{ToolEvent, tool_event}; +use crate::direct_select::PathRef; +use crate::state::Tool; + +/// The epic's test document: the saved path "Path 1", targeted in the Paths panel, with the closed +/// square A (100,300)-(300,500), the open line B (400,300)→(700,300) and the open S-curve C +/// (400,450)→(700,450). +fn path_one() -> PhotocraftApp { + let (mut app, _) = setup(Tool::AddAnchorPoint); + let path = json!({"subpaths": [ + {"closed": true, "knots": [[100, 300], [300, 300], [300, 500], [100, 500]]}, + {"closed": false, "knots": [[400, 300], [700, 300]]}, + {"closed": false, "knots": [{"anchor": [400, 450], "in": [400, 450], "out": [500, 350]}, {"anchor": [700, 450], "in": [600, 550], "out": [700, 450]}]}, + ]}); + app.run("path.set", json!({"name": "Path 1", "path": path})).unwrap(); + app.ui.selected_path = Some("Path 1".into()); + app +} + +fn path(app: &PhotocraftApp) -> Path { + app.session.active().unwrap().doc.paths[0].path.clone() +} + +fn undo_label(app: &PhotocraftApp) -> Option<&str> { + app.session.active().unwrap().history.undo_label() +} + +fn drag(app: &mut PhotocraftApp, from: [f64; 2], to: [f64; 2], mods: Modifiers) { + tool_event(app, ToolEvent::Down { x: from[0], y: from[1], pressure: 1.0 }, mods); + tool_event(app, ToolEvent::Move { x: (from[0] + to[0]) / 2.0, y: (from[1] + to[1]) / 2.0, pressure: 1.0 }, mods); + tool_event(app, ToolEvent::Move { x: to[0], y: to[1], pressure: 1.0 }, mods); + tool_event(app, ToolEvent::Up { x: to[0], y: to[1] }, mods); +} + +#[test] +fn alt_click_on_a_segment_selects_the_whole_subpath_and_adds_nothing() { + let mut app = path_one(); + let (before, n) = (path(&app), steps(&app)); + click_with_modifiers(&mut app, [200.0, 300.0], Modifiers::ALT); + app.sync_views(); + assert_eq!(path(&app), before, "no anchor added"); + assert_eq!(steps(&app), n, "no History step"); + let ds = &app.ui.direct_selection; + assert_eq!(ds.target, Some(PathRef::Saved(0))); + assert_eq!(ds.anchors, vec![[0, 0], [0, 1], [0, 2], [0, 3]], "A's four anchors"); +} + +#[test] +fn alt_drag_on_a_segment_copies_the_subpath_and_moves_the_copy_in_one_drag_path_step() { + let mut app = path_one(); + let (before, n) = (path(&app), steps(&app)); + // C's middle: the S-curve passes (550,450) at t = 0.5. + drag(&mut app, [550.0, 450.0], [550.0, 500.0], Modifiers::ALT); + app.sync_views(); + let p = path(&app); + assert_eq!(p.subpaths.len(), 4, "a fourth subpath"); + assert_eq!(p.subpaths[..3], before.subpaths[..], "A, B and C stay where they were"); + let copy = &p.subpaths[3]; + assert!(!copy.closed); + assert_eq!(copy.knots[0].anchor, Point::new(400.0, 500.0)); + assert_eq!(copy.knots[1].anchor, Point::new(700.0, 500.0)); + assert_eq!((copy.knots[0].out_ctrl, copy.knots[1].in_ctrl), (Point::new(500.0, 400.0), Point::new(600.0, 600.0)), "handles move with the copy"); + assert_eq!(steps(&app), n + 1); + assert_eq!(undo_label(&app), Some("Drag Path")); + assert_eq!(app.ui.direct_selection.anchors, vec![[3, 0], [3, 1]], "the copy is selected"); + assert!(app.session.undo()); + assert_eq!(path(&app), before); +} + +#[test] +fn alt_click_on_an_anchor_deletes_nothing() { + let mut app = path_one(); + let (before, n) = (path(&app), steps(&app)); + click_with_modifiers(&mut app, [100.0, 300.0], Modifiers::ALT); + assert_eq!(path(&app), before); + assert_eq!(steps(&app), n); + assert_ne!(undo_label(&app), Some("Delete Anchor Point")); +} + +#[test] +fn alt_drag_on_an_anchor_or_empty_canvas_edits_nothing() { + // Not measured in the reference: such a drag neither deletes nor copies. + let mut app = path_one(); + let (before, n) = (path(&app), steps(&app)); + drag(&mut app, [100.0, 300.0], [100.0, 350.0], Modifiers::ALT); + drag(&mut app, [200.0, 400.0], [200.0, 450.0], Modifiers::ALT); + assert_eq!((path(&app), steps(&app)), (before, n)); +} + +#[test] +fn delete_anchor_point_with_alt_still_adds_an_anchor() { + let mut app = path_one(); + app.ui.tool = Tool::DeleteAnchorPoint; + let n = steps(&app); + click_with_modifiers(&mut app, [200.0, 300.0], Modifiers::ALT); + assert_eq!(path(&app).subpaths[0].knots.len(), 5); + assert_eq!(steps(&app), n + 1); + assert_eq!(undo_label(&app), Some("Add Anchor Point")); +} + +/// The anchors of subpath `s` of a path in the compact JSON form (`[x, y]` corners or `{"anchor"}`). +fn json_anchors(v: &serde_json::Value, s: usize) -> Vec<[f64; 2]> { + let knots = v["subpaths"][s]["knots"].as_array().cloned().unwrap_or_default(); + knots.iter().map(|k| if k.is_array() { k } else { &k["anchor"] }).map(|a| [a[0].as_f64().unwrap(), a[1].as_f64().unwrap()]).collect() +} + +#[test] +fn alt_drag_copies_a_subpath_of_the_active_shape_layer() { + let (mut app, shape) = setup(Tool::AddAnchorPoint); + select_layer(&mut app, shape); + let (before, n) = (shape_path(&mut app, shape), steps(&app)); + drag(&mut app, [550.0, 100.0], [550.0, 60.0], Modifiers::ALT); + let after = shape_path(&mut app, shape); + assert_eq!(after["subpaths"].as_array().map(Vec::len), Some(2), "{after}"); + assert_eq!(json_anchors(&after, 0), json_anchors(&before, 0), "the original stays"); + let moved: Vec<[f64; 2]> = json_anchors(&before, 0).into_iter().map(|[x, y]| [x, y - 40.0]).collect(); + assert_eq!(json_anchors(&after, 1), moved); + assert_eq!(steps(&app), n + 1); + assert_eq!(undo_label(&app), Some("Drag Path")); +} + +#[test] +fn alt_shows_no_anchor_to_add_and_the_plus_badge_everywhere() { + let mut app = path_one(); + for at in [[200.0, 300.0], [200.0, 400.0]] { + app.hover_doc = Some(at); + assert_eq!(crate::canvas::tool_feedback::badge(&app, Tool::AddAnchorPoint, Modifiers::ALT), Some(crate::canvas::tool_feedback::Badge::Add), "{at:?}"); + } + assert_eq!(crate::anchor_tools::effective(Tool::AddAnchorPoint, Modifiers::ALT), Some(Tool::AddAnchorPoint)); + assert_eq!(crate::anchor_tools::effective(Tool::DeleteAnchorPoint, Modifiers::ALT), Some(Tool::AddAnchorPoint)); +} diff --git a/crates/ui-egui/src/tools/anchor_tools/tests.rs b/crates/ui-egui/src/tools/anchor_tools/tests.rs index ae58b9b611..6e14d25cf1 100644 --- a/crates/ui-egui/src/tools/anchor_tools/tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/tests.rs @@ -95,7 +95,7 @@ fn add_on_a_curve_splits_it_where_clicked() { } #[test] -fn delete_removes_the_clicked_anchor_and_alt_swaps_the_tools() { +fn delete_removes_the_clicked_anchor_and_alt_makes_it_add() { let mut app = app(Tool::DeleteAnchorPoint); with_path(&mut app); let n = steps(&app); @@ -104,15 +104,15 @@ fn delete_removes_the_clicked_anchor_and_alt_swaps_the_tools() { assert_eq!((p.subpaths[0].knots.len(), p.subpaths[0].closed), (3, true)); assert_eq!(p.subpaths[0].knots[2].anchor, Point::new(40.0, 120.0)); assert_eq!(app.session.active().unwrap().history.undo_label(), Some("Delete Anchor Point")); - // ⌥ with Delete adds; ⌥ with Add deletes. + // ⌥ with Delete adds; ⌥ with Add deletes nothing (#12709). click(&mut app, [80.0, 120.0], Modifiers::ALT); assert_eq!(work(&app).subpaths[0].knots.len(), 3, "the bottom edge is gone; ⌥ on empty canvas adds nothing"); click(&mut app, [40.0, 80.0], Modifiers::ALT); assert_eq!(work(&app).subpaths[0].knots.len(), 4); app.ui.tool = Tool::AddAnchorPoint; click(&mut app, [40.0, 80.0], Modifiers::ALT); - assert_eq!(work(&app).subpaths[0].knots.len(), 3); - assert_eq!(steps(&app), n + 3); + assert_eq!(work(&app).subpaths[0].knots.len(), 4); + assert_eq!(steps(&app), n + 2); } #[test] @@ -156,7 +156,7 @@ fn the_cursor_shows_plus_or_minus() { assert_eq!(badge(&app, Tool::AddAnchorPoint, Modifiers::NONE), None, "off the path's segments"); app.hover_doc = Some([80.0, 120.0]); assert_eq!(badge(&app, Tool::AddAnchorPoint, Modifiers::NONE), Some(Badge::Add)); - assert_eq!(badge(&app, Tool::AddAnchorPoint, Modifiers::ALT), Some(Badge::Subtract)); + assert_eq!(badge(&app, Tool::AddAnchorPoint, Modifiers::ALT), Some(Badge::Add), "⌥ is the arrow with \"+\" (#12709)"); assert_eq!(badge(&app, Tool::DeleteAnchorPoint, Modifiers::NONE), Some(Badge::Subtract)); assert_eq!(badge(&app, Tool::DeleteAnchorPoint, Modifiers::COMMAND), None, "⌘ is Direct Selection"); } diff --git a/crates/ui-egui/src/tools/direct_select.rs b/crates/ui-egui/src/tools/direct_select.rs index 3ee51b3862..8855eba73f 100644 --- a/crates/ui-egui/src/tools/direct_select.rs +++ b/crates/ui-egui/src/tools/direct_select.rs @@ -279,6 +279,9 @@ pub enum Edit { Path(Vec<[usize; 2]>), /// Pen + ⌥ on an anchor: a click makes a corner, a drag pulls out smooth handles. Convert([usize; 2]), + /// Add Anchor Point + ⌥ on a segment: a drag copies the subpath holding these anchors and moves + /// the copy (**Drag Path**); a click only selects the subpath. + Duplicate(Vec<[usize; 2]>), } impl Edit { @@ -300,6 +303,7 @@ impl Edit { Edit::Segment([s, k], t) => ("path.bendSegment", json!({"subpath": s, "knot": k, "t": t, "move": d})), Edit::Path(a) => ("path.moveAnchors", json!({"anchors": a, "move": d, "stepName": "Drag Path"})), Edit::Convert([s, k]) => ("path.convertPoint", json!({"subpath": s, "knot": k, "out": end})), + Edit::Duplicate(a) => ("path.moveAnchors", json!({"anchors": a, "move": d, "duplicate": true, "stepName": "Drag Path"})), } } @@ -313,6 +317,7 @@ impl Edit { Edit::Handle(k, h, from, independent) => edit::move_handle(&mut p, *k, *h, Point::new(from.x + d[0], from.y + d[1]), *independent), Edit::Segment(k, t) => edit::bend_segment(&mut p, *k, *t, d), Edit::Convert(k) => edit::convert_point(&mut p, *k, Some(Point::new(end[0], end[1]))), + Edit::Duplicate(a) => edit::duplicate_subpaths(&mut p, a, d).map(|_| ()), } .ok()?; Some(p) @@ -870,9 +875,17 @@ fn release(app: &mut PhotocraftApp, target: PathRef, base: &Path, edit: &Edit, s } // sync_views checks ownership while the command runs: keep this selection off the live UI // until its own command is done, then bind it to the revision that made. - let selection = std::mem::take(&mut app.ui.direct_selection); + let mut selection = std::mem::take(&mut app.ui.direct_selection); match app.run(id, params) { - Ok(_) => keep_after_command(app, selection), + Ok(_) => { + // A duplicated subpath leaves its copy selected, as in the reference. + if let Edit::Duplicate(a) = edit + && let Ok(copies) = edit::duplicate_subpaths(&mut base.clone(), a, [0.0, 0.0]) + { + selection.anchors = copies; + } + keep_after_command(app, selection); + } Err(e) => { if selection.owner.as_ref().is_some_and(|owner| owner.valid(app)) { app.ui.direct_selection = selection; diff --git a/crates/vector/src/edit.rs b/crates/vector/src/edit.rs index 83e7acbcc4..963fbb99e8 100644 --- a/crates/vector/src/edit.rs +++ b/crates/vector/src/edit.rs @@ -6,7 +6,7 @@ //! Knots are addressed as `[subpath, knot]`. Every edit validates its indices and returns an //! error message instead of panicking. -use photocraft_doc::{Knot, Path, Subpath}; +use photocraft_doc::{Knot, Path, PathOp, Subpath}; use photocraft_geom::Point; /// One of a knot's two direction handles. @@ -122,6 +122,33 @@ pub fn move_anchors(path: &mut Path, anchors: &[[usize; 2]], d: [f64; 2]) -> Res Ok(()) } +/// Add Anchor Point's ⌥-drag on a segment, as in Photoshop: the subpaths holding `anchors` are +/// copied to the end of the path, in order, and the copies move by `d`; the originals stay. A +/// copied joined subpath takes its component's operation, so the copy stands on its own. +/// Returns the copies' anchors. +pub fn duplicate_subpaths(path: &mut Path, anchors: &[[usize; 2]], d: [f64; 2]) -> Result, String> { + let mut subs = Vec::with_capacity(anchors.len()); + for &[s, k] in anchors { + path.subpaths.get(s).and_then(|sp| sp.knots.get(k)).ok_or_else(|| format!("no knot {k} in subpath {s}"))?; + subs.push(s); + } + subs.sort_unstable(); + subs.dedup(); + let mut copies = Vec::new(); + for s in subs { + let Some(mut sp) = path.subpaths.get(s).cloned() else { continue }; + if sp.op == PathOp::Join { + let head = path.subpaths.get(..s).and_then(|before| before.iter().rev().find(|h| h.op != PathOp::Join)); + sp.op = head.map_or(PathOp::Combine, |h| h.op); + } + let at = path.subpaths.len(); + copies.extend((0..sp.knots.len()).map(|k| [at, k])); + path.subpaths.push(sp); + } + move_anchors(path, &copies, d)?; + Ok(copies) +} + /// The Curvature Pen's anchor drag: moves the anchors like [`move_anchors`], then recomputes the /// handles of every smooth knot in the subpaths it touched with [`curvature_knots`], so the curve /// keeps flowing smoothly through all its anchors, as Photoshop does. Corner knots keep their own @@ -763,6 +790,23 @@ mod tests { assert_eq!(subpath_anchors(&p, 0), vec![[0, 0], [0, 1], [0, 2]]); assert!(subpath_anchors(&p, 4).is_empty()); } + + #[test] + fn duplicated_subpaths_go_to_the_end_and_a_joined_one_stands_alone() { + let mut p = tri(); + let mut joined = p.subpaths[0].clone(); + joined.op = PathOp::Join; + p.subpaths[0].op = PathOp::Subtract; + p.subpaths.push(joined); + let before = p.clone(); + let copies = duplicate_subpaths(&mut p, &[[1, 0], [1, 2]], [5.0, -5.0]).unwrap(); + assert_eq!(copies, vec![[2, 0], [2, 1], [2, 2]]); + assert_eq!(p.subpaths[..2], before.subpaths[..], "the originals stay"); + assert_eq!(p.subpaths[2].op, PathOp::Subtract, "the copy takes its component's operation"); + assert_eq!(p.subpaths[2].knots[0].anchor, add(before.subpaths[1].knots[0].anchor, [5.0, -5.0])); + assert!(duplicate_subpaths(&mut p, &[[9, 0]], [1.0, 1.0]).is_err()); + assert_eq!(p.subpaths.len(), 3, "a bad anchor copies nothing"); + } } #[cfg(test)] From 1b2e48e63c8503e9d132454b1d89b877880c17ff Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 21:03:57 +0100 Subject: [PATCH 10/17] Add Anchor Point: keep Alt from the press; a copy of the first component combines Review fixes for #12709: - The canvas captures the press modifiers for Add Anchor Point, so letting go of Alt before the drag is recognised still duplicates the subpath. - duplicate_subpaths gives a copy the operation its component draws with; the first component always combines, so its copy no longer subtracts a hole from the original. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/canvas.rs | 10 +++-- .../anchor_tools/add_anchor_alt_tests.rs | 39 +++++++++++++++++++ crates/vector/src/edit.rs | 33 ++++++++++------ 3 files changed, 67 insertions(+), 15 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 3ef790b6f8..71d11402af 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1041,9 +1041,13 @@ fn handle_primary_canvas_input(app: &mut PhotocraftApp, ui: &mut egui::Ui, view: ctx.request_repaint(); } // Capture intent at the press, before egui's drag threshold or click replay on release: - // Type transforms keep Command; selections keep Add/Subtract if Shift/Alt is released. - let capture_press = - tool.is_type() || matches!(tool, Tool::RectMarquee | Tool::EllipseMarquee | Tool::SingleRowMarquee | Tool::SingleColumnMarquee | Tool::ObjectSelection); + // Type transforms keep Command; selections keep Add/Subtract if Shift/Alt is released; Add + // Anchor Point keeps its Alt subpath duplicate (#12709). + let capture_press = tool.is_type() + || matches!( + tool, + Tool::RectMarquee | Tool::EllipseMarquee | Tool::SingleRowMarquee | Tool::SingleColumnMarquee | Tool::ObjectSelection | Tool::AddAnchorPoint + ); let tool_press = egui::Id::unique(("tool-pointer-press-modifiers", idx)); // Read from the raw events, so a dialog's modal layer doesn't block it: gated here, or a ⌘-press // under a dialog would start a type transform (#12896). diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs index 4f29cb6d63..6f07f5adcc 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs @@ -141,3 +141,42 @@ fn alt_shows_no_anchor_to_add_and_the_plus_badge_everywhere() { assert_eq!(crate::anchor_tools::effective(Tool::AddAnchorPoint, Modifiers::ALT), Some(Tool::AddAnchorPoint)); assert_eq!(crate::anchor_tools::effective(Tool::DeleteAnchorPoint, Modifiers::ALT), Some(Tool::AddAnchorPoint)); } + +#[test] +fn letting_go_of_alt_before_the_drag_starts_still_duplicates_the_subpath() { + // Through the real canvas: the tool sees the press only once egui recognises the drag, so the + // keys held at the press decide, as for the selection tools (CodeRabbit on #13977). + use egui::{Pos2, Rect, vec2}; + let ctx = egui::Context::default(); + let mut app = path_one(); + app.run("view.actualPixels", json!({})).unwrap(); + app.sync_views(); + let mut view = app.ui.views[0].clone(); + view.zoom = 1.0; + view.center = [400.0, 300.0]; + view.fit_pending = false; + view.fill_pending = false; + let rect = Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0)); + let frame = |app: &mut PhotocraftApp, events: Vec| { + let input = egui::RawInput { screen_rect: Some(rect), events, ..Default::default() }; + let mut out = ctx.run_ui(input, |ui| { + crate::canvas::canvas_view(app, ui, 0, rect, view.clone(), true); + }); + out.textures_delta.clear(); + }; + let press = |pos: Pos2, pressed: bool, modifiers: Modifiers| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers }; + let (alt, none) = (Modifiers::ALT, Modifiers::NONE); + let (before, n) = (path(&app), steps(&app)); + // C's middle, (550,450) in the document, is the same screen point at 100 % centred on the document. + let start = Pos2::new(550.0, 450.0); + frame(&mut app, vec![egui::Event::ModifiersChanged(alt), egui::Event::PointerMoved(start)]); + frame(&mut app, vec![press(start, true, alt)]); + frame(&mut app, vec![egui::Event::ModifiersChanged(none), egui::Event::PointerMoved(start + vec2(0.0, 25.0))]); + frame(&mut app, vec![egui::Event::PointerMoved(start + vec2(0.0, 50.0))]); + frame(&mut app, vec![press(start + vec2(0.0, 50.0), false, none)]); + let p = path(&app); + assert_eq!(p.subpaths.len(), 4, "the subpath was copied, no anchor added: {:?}", p.subpaths.iter().map(|s| s.knots.len()).collect::>()); + assert_eq!(p.subpaths[..3], before.subpaths[..]); + assert_eq!((p.subpaths[3].knots[0].anchor, p.subpaths[3].knots[1].anchor), (Point::new(400.0, 500.0), Point::new(700.0, 500.0))); + assert_eq!((steps(&app), undo_label(&app)), (n + 1, Some("Drag Path"))); +} diff --git a/crates/vector/src/edit.rs b/crates/vector/src/edit.rs index 963fbb99e8..b6573361e2 100644 --- a/crates/vector/src/edit.rs +++ b/crates/vector/src/edit.rs @@ -124,7 +124,8 @@ pub fn move_anchors(path: &mut Path, anchors: &[[usize; 2]], d: [f64; 2]) -> Res /// Add Anchor Point's ⌥-drag on a segment, as in Photoshop: the subpaths holding `anchors` are /// copied to the end of the path, in order, and the copies move by `d`; the originals stay. A -/// copied joined subpath takes its component's operation, so the copy stands on its own. +/// copy takes the operation its component draws with (the first component always combines), so it +/// stands on its own and cuts nothing out of the original. /// Returns the copies' anchors. pub fn duplicate_subpaths(path: &mut Path, anchors: &[[usize; 2]], d: [f64; 2]) -> Result, String> { let mut subs = Vec::with_capacity(anchors.len()); @@ -137,10 +138,12 @@ pub fn duplicate_subpaths(path: &mut Path, anchors: &[[usize; 2]], d: [f64; 2]) let mut copies = Vec::new(); for s in subs { let Some(mut sp) = path.subpaths.get(s).cloned() else { continue }; - if sp.op == PathOp::Join { - let head = path.subpaths.get(..s).and_then(|before| before.iter().rev().find(|h| h.op != PathOp::Join)); - sp.op = head.map_or(PathOp::Combine, |h| h.op); - } + // The component's first subpath, and the operation it is folded in with (`Path::effective_op`). + let head = (0..=s).rev().find(|&i| path.subpaths.get(i).is_some_and(|h| h.op != PathOp::Join)).unwrap_or(0); + sp.op = match path.subpaths.get(head) { + Some(h) if head > 0 => h.op, + _ => PathOp::Combine, + }; let at = path.subpaths.len(); copies.extend((0..sp.knots.len()).map(|k| [at, k])); path.subpaths.push(sp); @@ -793,19 +796,25 @@ mod tests { #[test] fn duplicated_subpaths_go_to_the_end_and_a_joined_one_stands_alone() { + // Subpath 0 stores Subtract but, being first, combines; 1 joins it; 2 subtracts, 3 joins 2. let mut p = tri(); - let mut joined = p.subpaths[0].clone(); - joined.op = PathOp::Join; p.subpaths[0].op = PathOp::Subtract; + let joined = Subpath { op: PathOp::Join, ..p.subpaths[0].clone() }; + p.subpaths.push(joined.clone()); + p.subpaths.push(Subpath { op: PathOp::Subtract, ..p.subpaths[0].clone() }); p.subpaths.push(joined); let before = p.clone(); let copies = duplicate_subpaths(&mut p, &[[1, 0], [1, 2]], [5.0, -5.0]).unwrap(); - assert_eq!(copies, vec![[2, 0], [2, 1], [2, 2]]); - assert_eq!(p.subpaths[..2], before.subpaths[..], "the originals stay"); - assert_eq!(p.subpaths[2].op, PathOp::Subtract, "the copy takes its component's operation"); - assert_eq!(p.subpaths[2].knots[0].anchor, add(before.subpaths[1].knots[0].anchor, [5.0, -5.0])); + assert_eq!(copies, vec![[4, 0], [4, 1], [4, 2]]); + assert_eq!(p.subpaths[..4], before.subpaths[..], "the originals stay"); + assert_eq!(p.subpaths[4].op, PathOp::Combine, "a copy of the first component combines, it cuts no hole in the original"); + assert_eq!(p.subpaths[4].knots[0].anchor, add(before.subpaths[1].knots[0].anchor, [5.0, -5.0])); + duplicate_subpaths(&mut p, &[[0, 0]], [5.0, 0.0]).unwrap(); + assert_eq!(p.subpaths[5].op, PathOp::Combine, "nor does a copy of the first subpath itself"); + duplicate_subpaths(&mut p, &[[3, 1]], [5.0, 0.0]).unwrap(); + assert_eq!(p.subpaths[6].op, PathOp::Subtract, "a later joined subpath takes its component's operation"); assert!(duplicate_subpaths(&mut p, &[[9, 0]], [1.0, 1.0]).is_err()); - assert_eq!(p.subpaths.len(), 3, "a bad anchor copies nothing"); + assert_eq!(p.subpaths.len(), 7, "a bad anchor copies nothing"); } } From e38b28c8ed5548de6b371d9357a0c1885c3e6cb2 Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 13 Nov 2026 21:14:41 +0100 Subject: [PATCH 11/17] Add Anchor Point: an Alt-click keeps Alt from the press (#12709) A click is replayed on release; Add Anchor Point now reads the keys held at the press, as Object Selection does, so letting go of Alt first still selects the subpath and adds no anchor. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/canvas.rs | 3 +- .../anchor_tools/add_anchor_alt_tests.rs | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 71d11402af..b57e2575ff 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -1573,7 +1573,8 @@ fn handle_canvas_tool_clicks( } else { let click_button = if app.secondary_erase { PointerButton::Secondary } else { PointerButton::Primary }; let click_mods = ui.input(|i| pointer_button_modifiers(&i.events, click_button)).unwrap_or(mods); - let click_mods = if tool == Tool::ObjectSelection && click_button == PointerButton::Primary { + // Add Anchor Point's ⌥-click selects the subpath even if ⌥ is let go first (#12709). + let click_mods = if matches!(tool, Tool::ObjectSelection | Tool::AddAnchorPoint) && click_button == PointerButton::Primary { ctx.data(|d| d.get_temp(tool_press)).unwrap_or(click_mods) } else { click_mods diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs index 6f07f5adcc..0b57b723fc 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs @@ -180,3 +180,39 @@ fn letting_go_of_alt_before_the_drag_starts_still_duplicates_the_subpath() { assert_eq!((p.subpaths[3].knots[0].anchor, p.subpaths[3].knots[1].anchor), (Point::new(400.0, 500.0), Point::new(700.0, 500.0))); assert_eq!((steps(&app), undo_label(&app)), (n + 1, Some("Drag Path"))); } + +#[test] +fn letting_go_of_alt_before_the_click_ends_still_selects_the_subpath() { + // Through the real canvas: a click is replayed on release, so the keys held at the press + // decide, as for Object Selection (CodeRabbit on #13977). + use egui::{Pos2, Rect, vec2}; + let ctx = egui::Context::default(); + let mut app = path_one(); + app.run("view.actualPixels", json!({})).unwrap(); + app.sync_views(); + let mut view = app.ui.views[0].clone(); + view.zoom = 1.0; + view.center = [400.0, 300.0]; + view.fit_pending = false; + view.fill_pending = false; + let rect = Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0)); + let frame = |app: &mut PhotocraftApp, events: Vec| { + let input = egui::RawInput { screen_rect: Some(rect), events, ..Default::default() }; + let mut out = ctx.run_ui(input, |ui| { + crate::canvas::canvas_view(app, ui, 0, rect, view.clone(), true); + }); + out.textures_delta.clear(); + }; + let press = |pos: Pos2, pressed: bool, modifiers: Modifiers| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers }; + let (alt, none) = (Modifiers::ALT, Modifiers::NONE); + let (before, n) = (path(&app), steps(&app)); + // A's top edge, (200,300) in the document. + let at = Pos2::new(200.0, 300.0); + frame(&mut app, vec![egui::Event::ModifiersChanged(alt), egui::Event::PointerMoved(at)]); + frame(&mut app, vec![press(at, true, alt)]); + frame(&mut app, vec![egui::Event::ModifiersChanged(none)]); + frame(&mut app, vec![press(at, false, none)]); + frame(&mut app, vec![]); + assert_eq!((path(&app), steps(&app)), (before, n), "no anchor added, no History step"); + assert_eq!(app.ui.direct_selection.anchors, vec![[0, 0], [0, 1], [0, 2], [0, 3]], "A's four anchors"); +} From 048277f61916b09efa50df376ad5009369fe62a8 Mon Sep 17 00:00:00 2001 From: David Mann Date: Mon, 16 Nov 2026 02:13:30 +0100 Subject: [PATCH 12/17] Address CodeRabbit review: a duplicated joined subpath stands alone path.moveAnchors with duplicate cloned the subpath with its stored operation, so a copy of a joined subpath (a component's hole) became part of whichever component was last. It now goes through edit::duplicate_subpaths, which keeps the source's operation (as measured for #13211) but gives a joined subpath's copy its component's stored operation. The helper no longer forces Combine on a copy of the first component, which contradicted the measured case. Direct Selection's drag preview uses the same helper. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/path_edit_cmds.rs | 44 ++++++++++++++++++----- crates/ui-egui/src/tools/direct_select.rs | 7 ++-- crates/vector/src/edit.rs | 27 +++++++------- 3 files changed, 50 insertions(+), 28 deletions(-) diff --git a/crates/engine/src/cmd/path_edit_cmds.rs b/crates/engine/src/cmd/path_edit_cmds.rs index a13c677509..98cbe43ccd 100644 --- a/crates/engine/src/cmd/path_edit_cmds.rs +++ b/crates/engine/src/cmd/path_edit_cmds.rs @@ -137,20 +137,19 @@ fn move_anchors(s: &mut Session, p: &Value) -> Result { let label = step_name(CMD, p, if duplicate { "Drag Path" } else { "Drag Anchor Points" }, &["Drag Path", "Drag Anchor Point"])?; let curvature = p.get("curvature").and_then(Value::as_bool).unwrap_or(false); edit_path(s, CMD, p, label, |path| { - let mut anchors = anchors; if duplicate { - // Direct Selection's ⌥-drag (#13211): the copy, with the source's operation, goes last - // and moves; the source stays. - let copy = path.subpaths.get(sub).cloned().ok_or_else(|| format!("no subpath {sub} (the path has {})", path.subpaths.len()))?; + // Direct Selection's and Add Anchor Point's ⌥-drag (#13211, #12709): the copy goes + // last and moves; the source stays. The copy keeps the source's operation, but a copy + // of a joined subpath takes its component's (`edit::duplicate_subpaths`), so it stands + // alone instead of joining whichever component is last. + let count = path.subpaths.get(sub).ok_or_else(|| format!("no subpath {sub} (the path has {})", path.subpaths.len()))?.knots.len(); let mut knots: Vec = anchors.iter().map(|a| a[1]).collect(); knots.sort_unstable(); knots.dedup(); - if !knots.iter().copied().eq(0..copy.knots.len()) { + if !knots.iter().copied().eq(0..count) { return Err("`duplicate` takes all the anchors of one subpath".into()); } - path.subpaths.push(copy); - let last = path.subpaths.len() - 1; - anchors.iter_mut().for_each(|a| a[0] = last); + return edit::duplicate_subpaths(path, &anchors, d).map(|_| ()); } if curvature { edit::move_anchors_curvature(path, &anchors, d) } else { edit::move_anchors(path, &anchors, d) } }) @@ -325,7 +324,7 @@ pub fn specs() -> Vec { journal: true, }; vec![ - spec("path.moveAnchors", "Drag Anchor Points", r#""anchors":[[subpath,knot],…],"move":[dx,dy],"curvature":bool=false (anchors move with their handles; Direct Selection drag. curvature = the Curvature Pen's drag: every smooth knot of the touched subpaths gets its handles recomputed so the curve flows through the anchors),"duplicate":bool=false (anchors = all of one subpath's; that subpath is copied, with its operation, as the path's last subpath, and the copy's anchors move instead; the source stays; Direct Selection's ⌥-drag on a segment, Add Anchor Point's ⌥-drag; not with curvature),"stepName":"Drag Path"|"Drag Anchor Point"? (History step name; the Convert Point tool sends "Drag Path" when it drags a whole path, Direct Selection "Drag Anchor Point" when it drags one anchor, Add Anchor Point "Drag Path" when it duplicates a subpath; default "Drag Anchor Points", "Drag Path" with duplicate; any other value is refused)"#.into(), move_anchors), + spec("path.moveAnchors", "Drag Anchor Points", r#""anchors":[[subpath,knot],…],"move":[dx,dy],"curvature":bool=false (anchors move with their handles; Direct Selection drag. curvature = the Curvature Pen's drag: every smooth knot of the touched subpaths gets its handles recomputed so the curve flows through the anchors),"duplicate":bool=false (anchors = all of one subpath's; that subpath is copied, with its operation (a joined subpath's copy takes its component's), as the path's last subpath, and the copy's anchors move instead; the source stays; Direct Selection's ⌥-drag on a segment, Add Anchor Point's ⌥-drag; not with curvature),"stepName":"Drag Path"|"Drag Anchor Point"? (History step name; the Convert Point tool sends "Drag Path" when it drags a whole path, Direct Selection "Drag Anchor Point" when it drags one anchor, Add Anchor Point "Drag Path" when it duplicates a subpath; default "Drag Anchor Points", "Drag Path" with duplicate; any other value is refused)"#.into(), move_anchors), spec( "path.moveHandle", "Drag Control Point", @@ -911,6 +910,33 @@ mod tests { assert!(s.undo()); assert_eq!(work(&s), before); } + + /// A copy of a joined subpath (a component's hole) takes its component's operation and stands + /// alone: it never joins the last component, which would cut it out of that one instead. + #[test] + fn a_duplicated_joined_subpath_stands_alone() { + let mut s = session(); + s.execute( + "path.set", + json!({"path": {"subpaths": [ + {"closed": true, "knots": [[10, 10], [60, 10], [60, 60], [10, 60]]}, + {"closed": true, "op": "join", "knots": [[25, 25], [25, 45], [45, 45], [45, 25]]}, + {"closed": true, "op": "subtract", "knots": [[70, 10], [110, 10], [110, 50], [70, 50]]}, + ]}}), + ) + .unwrap(); + let before = work(&s); + let at = |p: &photocraft_doc::Path, x: i32, y: i32| photocraft_vector::path_coverage(p, photocraft_geom::Rect::new(x, y, x + 1, y + 1))[0]; + assert_eq!((at(&before, 35, 35), at(&before, 15, 15), at(&before, 90, 35)), (0.0, 1.0, 0.0), "A has its hole; B cuts nothing"); + s.execute("path.moveAnchors", json!({"anchors": [[1, 0], [1, 1], [1, 2], [1, 3]], "move": [55, 0], "duplicate": true})).unwrap(); + let after = work(&s); + assert_eq!(after.subpaths[..3], before.subpaths[..], "the source stays"); + assert_eq!(after.subpaths.len(), 4); + assert_eq!(after.subpaths[3].op, PathOp::Combine, "the copy of A's hole takes A's operation"); + assert_eq!(after.components(), vec![0..2, 2..3, 3..4], "the copy is a component of its own"); + assert_eq!(at(&after, 90, 35), 1.0, "the copy fills where it landed"); + assert_eq!((at(&after, 35, 35), at(&after, 15, 15)), (0.0, 1.0), "A and its hole are unchanged"); + } } #[cfg(test)] diff --git a/crates/ui-egui/src/tools/direct_select.rs b/crates/ui-egui/src/tools/direct_select.rs index 10bcd950cb..ccfcd5dc40 100644 --- a/crates/ui-egui/src/tools/direct_select.rs +++ b/crates/ui-egui/src/tools/direct_select.rs @@ -321,11 +321,8 @@ impl Edit { Edit::Handle(k, h, from, independent) => edit::move_handle(&mut p, *k, *h, Point::new(from.x + d[0], from.y + d[1]), *independent), Edit::Segment(k, t) => edit::bend_segment(&mut p, *k, *t, d), Edit::Convert(k) => edit::convert_point(&mut p, *k, Some(Point::new(end[0], end[1]))), - Edit::Duplicate(a) => { - p.subpaths.push(p.subpaths.get(a.first()?[0])?.clone()); - let last = p.subpaths.len() - 1; - edit::move_anchors(&mut p, &a.iter().map(|&[_, k]| [last, k]).collect::>(), d) - } + // As `path.moveAnchors` with `duplicate`: the copy takes its component's operation. + Edit::Duplicate(a) => edit::duplicate_subpaths(&mut p, a, d).map(|_| ()), } .ok()?; Some(p) diff --git a/crates/vector/src/edit.rs b/crates/vector/src/edit.rs index 97fc3f8d97..7ce05d641a 100644 --- a/crates/vector/src/edit.rs +++ b/crates/vector/src/edit.rs @@ -123,10 +123,11 @@ pub fn move_anchors(path: &mut Path, anchors: &[[usize; 2]], d: [f64; 2]) -> Res } /// Add Anchor Point's ⌥-drag on a segment, as in Photoshop: the subpaths holding `anchors` are -/// copied to the end of the path, in order, and the copies move by `d`; the originals stay. A -/// copy takes the operation its component draws with (the first component always combines), so it -/// stands on its own and cuts nothing out of the original. -/// Returns the copies' anchors. +/// copied to the end of the path, in order, and the copies move by `d`; the originals stay. A copy +/// keeps its source's operation, as measured in the reference (#13211: a copy of the first +/// subpath, stored Exclude, stays Exclude). A copy of a joined subpath takes its component's +/// stored operation instead, so it stands on its own rather than joining whichever component is +/// last. Returns the copies' anchors. pub fn duplicate_subpaths(path: &mut Path, anchors: &[[usize; 2]], d: [f64; 2]) -> Result, String> { let mut subs = Vec::with_capacity(anchors.len()); for &[s, k] in anchors { @@ -138,12 +139,10 @@ pub fn duplicate_subpaths(path: &mut Path, anchors: &[[usize; 2]], d: [f64; 2]) let mut copies = Vec::new(); for s in subs { let Some(mut sp) = path.subpaths.get(s).cloned() else { continue }; - // The component's first subpath, and the operation it is folded in with (`Path::effective_op`). - let head = (0..=s).rev().find(|&i| path.subpaths.get(i).is_some_and(|h| h.op != PathOp::Join)).unwrap_or(0); - sp.op = match path.subpaths.get(head) { - Some(h) if head > 0 => h.op, - _ => PathOp::Combine, - }; + if sp.op == PathOp::Join { + // The operation stored on the component's first subpath (`Path::components`). + sp.op = path.subpaths.get(..s).unwrap_or_default().iter().rev().map(|h| h.op).find(|&op| op != PathOp::Join).unwrap_or(PathOp::Combine); + } let at = path.subpaths.len(); copies.extend((0..sp.knots.len()).map(|k| [at, k])); path.subpaths.push(sp); @@ -957,9 +956,9 @@ mod tests { #[test] fn duplicated_subpaths_go_to_the_end_and_a_joined_one_stands_alone() { - // Subpath 0 stores Subtract but, being first, combines; 1 joins it; 2 subtracts, 3 joins 2. + // Subpath 0 stores Exclude (being first, it draws as Combine); 1 joins it; 2 subtracts, 3 joins 2. let mut p = tri(); - p.subpaths[0].op = PathOp::Subtract; + p.subpaths[0].op = PathOp::Exclude; let joined = Subpath { op: PathOp::Join, ..p.subpaths[0].clone() }; p.subpaths.push(joined.clone()); p.subpaths.push(Subpath { op: PathOp::Subtract, ..p.subpaths[0].clone() }); @@ -968,10 +967,10 @@ mod tests { let copies = duplicate_subpaths(&mut p, &[[1, 0], [1, 2]], [5.0, -5.0]).unwrap(); assert_eq!(copies, vec![[4, 0], [4, 1], [4, 2]]); assert_eq!(p.subpaths[..4], before.subpaths[..], "the originals stay"); - assert_eq!(p.subpaths[4].op, PathOp::Combine, "a copy of the first component combines, it cuts no hole in the original"); + assert_eq!(p.subpaths[4].op, PathOp::Exclude, "a joined subpath's copy takes its component's stored operation"); assert_eq!(p.subpaths[4].knots[0].anchor, add(before.subpaths[1].knots[0].anchor, [5.0, -5.0])); duplicate_subpaths(&mut p, &[[0, 0]], [5.0, 0.0]).unwrap(); - assert_eq!(p.subpaths[5].op, PathOp::Combine, "nor does a copy of the first subpath itself"); + assert_eq!(p.subpaths[5].op, PathOp::Exclude, "a copy of the first subpath keeps its stored operation, as measured (#13211)"); duplicate_subpaths(&mut p, &[[3, 1]], [5.0, 0.0]).unwrap(); assert_eq!(p.subpaths[6].op, PathOp::Subtract, "a later joined subpath takes its component's operation"); assert!(duplicate_subpaths(&mut p, &[[9, 0]], [1.0, 1.0]).is_err()); From 275d1715a9ac60fc3809b2e8c73d0e17c1b61922 Mon Sep 17 00:00:00 2001 From: David Mann Date: Thu, 19 Nov 2026 18:54:02 +0100 Subject: [PATCH 13/17] Add Anchor Point: pin craft-libs at the merge of storytold/craft-libs#2283 (#12708) Moves every craft-libs pin at 04ba41419b to 815e6a2389 on next, which brings the overlay's anchor and handle editing for Add Anchor Point (craft-libs#2283) and its Alt subpath handling (craft-libs#2284). PhotoCraft already maps these edits; the new tests drive them through the canvas and fail with the old pin. The test that expected Add Anchor Point + Alt to delete an anchor now expects it to delete nothing. craft-svg keeps its own rev. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 222 +++++++++--------- Cargo.toml | 68 +++--- crates/engine/Cargo.toml | 2 +- .../anchor_tools/add_anchor_select_tests.rs | 127 +++------- .../ui-egui/src/tools/anchor_tools/tests.rs | 8 +- .../ui-egui/src/tools/direct_select/edits.rs | 3 + 6 files changed, 181 insertions(+), 249 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4465866385..aeb4a93c80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1365,7 +1365,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-automation", "craft-behavior", @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "crc32fast", "flate2", @@ -1425,7 +1425,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "rustix 1.1.5", ] @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "base64 0.22.1", "craft-ai-agents", @@ -1459,7 +1459,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1475,7 +1475,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-docpath", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "egui", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "md-5", "rayon", @@ -1510,7 +1510,7 @@ dependencies = [ [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-cms", @@ -1530,17 +1530,17 @@ dependencies = [ [[package]] name = "craft-crs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "thiserror 2.0.21", ] [[package]] name = "craft-crw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "thiserror 2.0.21", ] @@ -1548,7 +1548,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "rayon", ] @@ -1564,7 +1564,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "block2 0.6.2", "craft-atomic", @@ -1587,7 +1587,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "serde", ] @@ -1595,7 +1595,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1614,21 +1614,21 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" [[package]] name = "craft-file-formats" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-eps", "craft-idml", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-kra", "craft-ora", "craft-pcraft-bundle", "craft-raw", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-zip", "serde", "serde_json", @@ -1637,7 +1637,7 @@ dependencies = [ [[package]] name = "craft-flags" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-atomic", "dirs", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1662,7 +1662,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "cap-primitives", "craft-atomic", @@ -1702,12 +1702,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" [[package]] name = "craft-heif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "heic-rs", "rayon", @@ -1716,7 +1716,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1729,7 +1729,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "chrono", "fixed_decimal", @@ -1757,9 +1757,9 @@ dependencies = [ [[package]] name = "craft-idml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-zip", "thiserror 2.0.21", ] @@ -1767,13 +1767,13 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-dds 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-dds 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-heif", - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "crc32fast", "exr", "flate2", @@ -1822,7 +1822,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1845,7 +1845,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=e7873217287876f76a0455 [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "thiserror 2.0.21", ] @@ -1861,11 +1861,11 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-host", "craft-i18n", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "egui", "serde", "serde_json", @@ -1874,9 +1874,9 @@ dependencies = [ [[package]] name = "craft-kra" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-zip", "thiserror 2.0.21", ] @@ -1884,7 +1884,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-i18n", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -1916,11 +1916,11 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "brotli-decompressor 6.3.2", "chrono", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "quick-xml 0.41.0", "serde", ] @@ -1940,9 +1940,9 @@ dependencies = [ [[package]] name = "craft-ora" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-zip", "thiserror 2.0.21", ] @@ -1950,7 +1950,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-text", @@ -1964,7 +1964,7 @@ dependencies = [ [[package]] name = "craft-pcraft-bundle" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "blake3", "craft-atomic", @@ -1977,7 +1977,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "serde", @@ -1988,7 +1988,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bytemuck", "flate2", @@ -2003,7 +2003,7 @@ dependencies = [ [[package]] name = "craft-pdn" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2012,7 +2012,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "async-channel", "async-io", @@ -2038,7 +2038,7 @@ dependencies = [ [[package]] name = "craft-plist" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "thiserror 2.0.21", ] @@ -2046,7 +2046,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-ui", @@ -2064,7 +2064,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "encoding_rs", "flate2", @@ -2075,7 +2075,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "dispatch2", "egui", @@ -2086,12 +2086,12 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "chrono", "craft-crw", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "jxl-oxide", "miniz_oxide 0.9.1", "rayon", @@ -2104,7 +2104,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -2121,7 +2121,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-atomic", "craft-host", @@ -2135,9 +2135,9 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "flate2", "kurbo 0.13.1", "quick-xml 0.41.0", @@ -2173,7 +2173,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-keymap", @@ -2185,7 +2185,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2208,7 +2208,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bitflags 2.13.2", "ecolor", @@ -2221,7 +2221,7 @@ dependencies = [ [[package]] name = "craft-theme-editor" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-theme", @@ -2232,7 +2232,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-atomic", "craft-behavior", @@ -2247,7 +2247,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "serde", "thiserror 2.0.21", @@ -2265,7 +2265,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "serde", "thiserror 2.0.21", @@ -2274,7 +2274,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-keymap", @@ -2289,7 +2289,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-i18n", @@ -2319,7 +2319,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "accesskit", "craft-behavior", @@ -2331,7 +2331,7 @@ dependencies = [ "craft-platform", "craft-quit", "craft-settings", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-theme", "craft-ui-macros", "craft-window", @@ -2353,7 +2353,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2364,7 +2364,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -2382,7 +2382,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -2403,13 +2403,13 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", "craft-i18n", "craft-platform", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-theme", "craft-ui-macros", "craft-ui-panels", @@ -2422,7 +2422,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -2439,7 +2439,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "chrono", "craft-host", @@ -2468,7 +2468,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "winsafe", ] @@ -2476,7 +2476,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-atomic", "craft-behavior", @@ -2506,7 +2506,7 @@ dependencies = [ [[package]] name = "craft-xcf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2515,7 +2515,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2535,7 +2535,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "thiserror 2.0.21", @@ -3998,7 +3998,7 @@ dependencies = [ [[package]] name = "hayro" version = "0.7.1" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bytemuck", "hayro-interpret", @@ -4028,7 +4028,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -4046,7 +4046,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -4070,7 +4070,7 @@ checksum = "bc2d80da85f31c3fdc0366431f44cfd645a9da1e242ed1f4a61f213d9765660f" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "hayro-ccitt", @@ -5154,7 +5154,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "arrayvec", "kurbo 0.13.1", @@ -6371,10 +6371,10 @@ dependencies = [ "core-graphics2", "craft", "craft-cms", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", "craft-update", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "eframe", "egui", "egui_kittest", @@ -6418,7 +6418,7 @@ name = "photocraft-algo" version = "0.23.1" dependencies = [ "craft", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "criterion", "photocraft-color", "photocraft-geom", @@ -6438,7 +6438,7 @@ dependencies = [ "cap-std", "clap", "craft", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-psd", "getrandom 0.3.4", "photocraft-color", @@ -6471,7 +6471,7 @@ dependencies = [ "clap_mangen", "craft", "craft-cms", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-psd", "photocraft-automation", "photocraft-doc", @@ -6535,11 +6535,11 @@ dependencies = [ "craft-affinity", "craft-cms", "craft-file-formats", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-pcraft-format", "craft-print", "craft-psd", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "exr", "flate2", "photocraft-algo", @@ -6575,7 +6575,7 @@ name = "photocraft-format" version = "0.23.1" dependencies = [ "blake3", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-pcraft-bundle", "craft-pcraft-format", "craft-zip", @@ -6635,16 +6635,16 @@ dependencies = [ "craft-crs", "craft-docpath", "craft-file-formats", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-kra", "craft-ora", "craft-pdf", "craft-pdn", "craft-psd", "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-xcf", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "crc32fast", "flate2", "kurbo 0.13.1", @@ -6743,7 +6743,7 @@ dependencies = [ name = "photocraft-raw" version = "0.23.1" dependencies = [ - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-raw", "flate2", "image", @@ -6805,7 +6805,7 @@ dependencies = [ "craft", "craft-file-formats", "craft-i18n", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-print", "craft-psd", "eframe", @@ -6854,7 +6854,7 @@ dependencies = [ name = "photocraft-web" version = "0.23.1" dependencies = [ - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-psd", "eframe", "egui", @@ -11224,14 +11224,14 @@ source = "git+https://github.com/storytold/egui.git?rev=e9711ca9b69772f875ae0d1c [[patch.unused]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" [[patch.unused]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" [[patch.unused]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" diff --git a/Cargo.toml b/Cargo.toml index 5d271814fe..1f55ba2b82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,19 +12,19 @@ rust-version = "1.95" [workspace.dependencies] # The craft framework through its facade (`craft::ui::…`). The egui `[patch]` below must match # `craft::egui_fork::REV` (checked by `cargo xtask ci`). -craft = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee", default-features = false } +craft = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5", default-features = false } # internal photocraft-geom = { path = "crates/geom" } photocraft-color = { path = "crates/color" } photocraft-raster = { path = "crates/raster" } photocraft-doc = { path = "crates/doc" } photocraft-ops = { path = "crates/ops" } -craft-plist = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -photocraft-codecs = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -photocraft-formats = { package = "craft-file-formats", git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee", features = ["raster-codecs", "pdf", "svg", "ora", "kra", "xcf", "pdn", "raw", "psd", "affinity", "pcraft"] } +craft-plist = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +photocraft-codecs = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +photocraft-formats = { package = "craft-file-formats", git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5", features = ["raster-codecs", "pdf", "svg", "ora", "kra", "xcf", "pdn", "raw", "psd", "affinity", "pcraft"] } photocraft-raw = { path = "crates/raw" } -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } photocraft-compose = { path = "crates/compose" } photocraft-gpu = { path = "crates/gpu" } photocraft-paint = { path = "crates/paint" } @@ -43,34 +43,34 @@ photocraft-ipp = { path = "crates/ipp" } # external # ICC colour management: the shared crate (replaces crates/cms; craft-libs#779). -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-print = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-print = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # HEIC/HEIF: the shared decoder (replaces crates/heif; craft-libs#784). -craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee", features = ["raster", "write-raster"] } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-pcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-pcraft-bundle = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-ora = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-kra = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-xcf = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-pdn = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5", features = ["raster", "write-raster"] } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-pcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-pcraft-bundle = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-ora = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-kra = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-xcf = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-pdn = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # Keep the shared embedded-image validation API until the framework revision includes it. craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "7b8c1eccea0c695a495ab279c9523e6efcc9b8be", features = ["tree-render", "tree-render-system-fonts"] } -craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # Camera-field EXIF reader/writer, shared prerequisite craft-libs#1563. -craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-crs = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-crs = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # Interface translations: lookup, fallback, CLDR plurals and language names over the craft-i18n # catalogs that `crates/ui-egui/build.rs` embeds from `CRAFT_I18N_DIR` (storytold/craft-i18n, at # the commit in `craft-i18n.rev`). Already in the tree through craft. -craft-i18n = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-i18n = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee", features = ["ui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "815e6a2389559226232a582846f9164e4dab0ea5", features = ["ui"] } thiserror = "2" serde = { version = "1", features = ["derive", "rc"] } serde_json = "1" @@ -335,14 +335,14 @@ opt-level = 3 # Keep the complete egui family and native event bridge on reviewed fork commits. [patch.crates-io] -krilla = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "e9711ca9b69772f875ae0d1cef1977ff8c16234d" } emath = { git = "https://github.com/storytold/egui.git", rev = "e9711ca9b69772f875ae0d1cef1977ff8c16234d" } epaint = { git = "https://github.com/storytold/egui.git", rev = "e9711ca9b69772f875ae0d1cef1977ff8c16234d" } diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index b28eeb44cd..e1e4c7654b 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -16,7 +16,7 @@ photocraft-geom = { workspace = true } photocraft-color = { workspace = true } craft-cms = { workspace = true } # PCTIP codec from craft-libs#1564; isolated pin until the shared revision is adopted workspace-wide. -craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } photocraft-raster = { workspace = true } photocraft-doc = { workspace = true } photocraft-ops = { workspace = true } diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs index 70cf7e195d..22aa23f965 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_select_tests.rs @@ -1,15 +1,16 @@ //! #12708: Add Anchor Point selects, moves and reshapes existing anchors and handles as Direct -//! Selection does, and a click on a segment still adds an anchor. +//! Selection does, and a click on a segment still adds an anchor. The overlay reports these edits +//! (craft-libs#2283); these tests check that PhotoCraft turns them into the right commands and +//! History steps. use egui::Modifiers; use photocraft_doc::vector::Path; use photocraft_geom::Point; -use photocraft_vector::edit::{Handle, Hit}; use serde_json::json; use super::delete_anchor_targeted_path_tests::{setup, steps}; use crate::PhotocraftApp; -use crate::canvas::{ToolEvent, tool_event}; +use crate::canvas::testing; use crate::direct_select::PathRef; use crate::state::Tool; @@ -27,7 +28,7 @@ fn target_path_1(app: &mut PhotocraftApp) { app.ui.selected_path = Some("Path 1".into()); } -fn tool_app(tool: Tool) -> PhotocraftApp { +fn tool_app(tool: Tool) -> Box { let (mut app, _) = setup(tool); target_path_1(&mut app); app @@ -46,46 +47,20 @@ fn label(app: &PhotocraftApp) -> Option { } fn click(app: &mut PhotocraftApp, at: [f64; 2], mods: Modifiers) { - drag(app, at, at, mods); + testing::click(app, at, mods); } fn drag(app: &mut PhotocraftApp, from: [f64; 2], to: [f64; 2], mods: Modifiers) { - tool_event(app, ToolEvent::Down { x: from[0], y: from[1], pressure: 1.0 }, mods); - tool_event(app, ToolEvent::Move { x: to[0], y: to[1], pressure: 1.0 }, mods); - tool_event(app, ToolEvent::Up { x: to[0], y: to[1] }, mods); -} - -/// The History step Direct Selection records for the same gesture: Add Anchor Point names its -/// anchor and handle drags as Direct Selection does. -fn direct_selection_label(gesture: impl Fn(&mut PhotocraftApp)) -> Option { - let mut app = tool_app(Tool::DirectSelection); - gesture(&mut app); - label(&app) + testing::press(app, from, mods); + testing::move_to(app, [(from[0] + to[0]) / 2.0, (from[1] + to[1]) / 2.0], mods); + testing::move_to(app, to, mods); + testing::release(app, to, mods); } fn close(got: Point, want: [f64; 2], what: &str) { assert!((got.x - want[0]).abs() <= 0.5 && (got.y - want[1]).abs() <= 0.5, "{what}: got ({}, {}), want {want:?}", got.x, got.y); } -#[test] -fn after_a_click_on_a_segment_the_new_anchor_is_the_only_selected_one_and_its_handles_show() { - let mut app = tool_app(Tool::AddAnchorPoint); - click(&mut app, [100.0, 300.0], Modifiers::NONE); - assert_eq!(app.ui.direct_selection.anchors, vec![[0, 0]]); - let n = steps(&app); - // The curve's first segment, (450,450) to the smooth anchor. - let on_curve = photocraft_vector::edit::eval(&path(&app).subpaths[1].segments()[0], 0.5); - click(&mut app, [on_curve.x, on_curve.y], Modifiers::NONE); - assert_eq!(steps(&app), n + 1); - assert_eq!(label(&app).as_deref(), Some("Add Anchor Point")); - assert_eq!(app.ui.direct_selection.target, Some(PathRef::Saved(0))); - assert_eq!(app.ui.direct_selection.anchors, vec![[1, 1]], "the new anchor is the only selected one"); - let added = knot(&app, 1, 1); - let out = [added.out_ctrl.x, added.out_ctrl.y]; - assert_ne!(added.out_ctrl, added.anchor, "a curve split gives the anchor handles"); - assert_eq!(crate::direct_select::hit_active_handles(&app, out).map(|h| h.2), Some(Hit::Handle([1, 1], Handle::Out)), "its handles are shown"); -} - #[test] fn a_click_on_an_anchor_selects_it_shift_adds_and_empty_canvas_deselects_without_steps() { let mut app = tool_app(Tool::AddAnchorPoint); @@ -104,86 +79,63 @@ fn a_click_on_an_anchor_selects_it_shift_adds_and_empty_canvas_deselects_without } #[test] -fn dragging_an_anchor_moves_it_with_its_handles_in_one_step() { - let gesture = |app: &mut PhotocraftApp| drag(app, [300.0, 300.0], [330.0, 280.0], Modifiers::NONE); +fn dragging_an_anchor_moves_it_with_its_handles_in_one_drag_anchor_point_step() { let mut app = tool_app(Tool::AddAnchorPoint); let n = steps(&app); - gesture(&mut app); + drag(&mut app, [300.0, 300.0], [330.0, 280.0], Modifiers::NONE); let k = knot(&app, 0, 1); - assert_eq!((k.anchor, k.in_ctrl, k.out_ctrl), (Point::new(330.0, 280.0), Point::new(330.0, 280.0), Point::new(330.0, 280.0))); + close(k.anchor, [330.0, 280.0], "anchor"); + close(k.in_ctrl, [330.0, 280.0], "in"); + close(k.out_ctrl, [330.0, 280.0], "out"); assert_eq!(path(&app).subpaths[0].knots.len(), 4, "no anchor added"); assert_eq!(steps(&app), n + 1); - let name = label(&app); - assert!(matches!(name.as_deref(), Some("Drag Anchor Point" | "Drag Anchor Points")), "{name:?}"); - assert_eq!(name, direct_selection_label(gesture)); + assert_eq!(label(&app).as_deref(), Some("Drag Anchor Point")); assert_eq!(app.ui.direct_selection.anchors, vec![[0, 1]], "the dragged anchor stays selected"); } #[test] fn dragging_a_smooth_anchors_out_handle_turns_the_in_handle_and_keeps_its_length() { - let gesture = |app: &mut PhotocraftApp| { - click(app, [549.5, 340.0], Modifiers::NONE); - drag(app, [624.7, 340.0], [624.7, 300.0], Modifiers::NONE); - }; let mut app = tool_app(Tool::AddAnchorPoint); let n = steps(&app); - gesture(&mut app); + click(&mut app, [549.5, 340.0], Modifiers::NONE); + assert_eq!(steps(&app), n, "the selecting click records nothing"); + drag(&mut app, [624.7, 340.0], [624.7, 300.0], Modifiers::NONE); let k = knot(&app, 1, 1); close(k.anchor, [549.5, 340.0], "anchor"); close(k.out_ctrl, [624.7, 300.0], "out"); close(k.in_ctrl, [483.4, 375.2], "in"); - assert_eq!(steps(&app), n + 1, "the selecting click records nothing, the drag one step"); - let name = label(&app); - assert!(matches!(name.as_deref(), Some("Drag Control Point" | "Drag Direction Point")), "{name:?}"); - assert_eq!(name, direct_selection_label(gesture)); + assert_eq!(steps(&app), n + 1, "the drag is one step"); + assert_eq!(label(&app).as_deref(), Some("Drag Control Point")); } #[test] fn alt_dragging_a_handle_moves_only_that_handle() { - let gesture = |app: &mut PhotocraftApp| { - click(app, [549.5, 340.0], Modifiers::NONE); - drag(app, [474.7, 340.0], [474.7, 300.0], Modifiers::ALT); - }; let mut app = tool_app(Tool::AddAnchorPoint); + click(&mut app, [549.5, 340.0], Modifiers::NONE); let n = steps(&app); - gesture(&mut app); + drag(&mut app, [474.7, 340.0], [474.7, 300.0], Modifiers::ALT); let k = knot(&app, 1, 1); close(k.in_ctrl, [474.7, 300.0], "in"); close(k.out_ctrl, [624.7, 340.0], "out unchanged"); close(k.anchor, [549.5, 340.0], "anchor"); assert_eq!(path(&app).subpaths[1].knots.len(), 3, "⌥ on a handle neither adds nor deletes"); assert_eq!(steps(&app), n + 1); - let name = label(&app); - assert!(matches!(name.as_deref(), Some("Drag Control Point" | "Drag Direction Point")), "{name:?}"); - assert_eq!(name, direct_selection_label(gesture)); + assert_eq!(label(&app).as_deref(), Some("Drag Control Point")); } #[test] -fn a_click_on_a_segment_still_adds_an_anchor_with_no_anchor_selected() { +fn a_click_on_a_segment_still_adds_an_anchor_and_selects_only_it() { let mut app = tool_app(Tool::AddAnchorPoint); click(&mut app, [300.0, 300.0], Modifiers::NONE); - click(&mut app, [50.0, 50.0], Modifiers::NONE); - assert!(app.ui.direct_selection.anchors.is_empty()); let n = steps(&app); - click(&mut app, [200.0, 300.0], Modifiers::NONE); + click(&mut app, [200.0, 500.0], Modifiers::NONE); assert_eq!(path(&app).subpaths[0].knots.len(), 5); assert_eq!(steps(&app), n + 1); assert_eq!(label(&app).as_deref(), Some("Add Anchor Point")); + assert_eq!(app.ui.direct_selection.anchors, vec![[0, 3]], "the new anchor is the only selected one"); } -/// Not measured, so as today: ⌥-click on an anchor with Add Anchor Point is Delete Anchor Point. -#[test] -fn alt_click_on_an_anchor_still_deletes_it() { - let mut app = tool_app(Tool::AddAnchorPoint); - let n = steps(&app); - click(&mut app, [300.0, 300.0], Modifiers::ALT); - assert_eq!(path(&app).subpaths[0].knots.len(), 3); - assert_eq!(steps(&app), n + 1); - assert_eq!(label(&app).as_deref(), Some("Delete Anchor Point")); -} - -/// A press on a handle that is not shown (its anchor is not selected) grabs nothing: the press -/// falls through to the segment test, and off every segment it only deselects. +/// A press on a handle that is not shown (its anchor is not selected) grabs nothing. #[test] fn a_hidden_handle_is_not_grabbed() { let mut app = tool_app(Tool::AddAnchorPoint); @@ -191,26 +143,3 @@ fn a_hidden_handle_is_not_grabbed() { drag(&mut app, [624.7, 340.0], [624.7, 300.0], Modifiers::NONE); assert_eq!((path(&app), steps(&app)), (before, n)); } - -/// ⌥-drag on a shown handle that lies on a straight segment moves the handle alone; the segment -/// under it is not bent (⌥ makes the press Delete Anchor Point, whose segment drag must not win). -#[test] -fn alt_drag_on_a_shown_handle_over_a_straight_segment_moves_the_handle() { - let (mut app, _) = setup(Tool::AddAnchorPoint); - let doc_path = json!({"subpaths": [ - {"closed": true, "knots": [[100, 300], [300, 300], [300, 500], [100, 500]]}, - {"closed": false, "knots": [ - [100, 200], - {"anchor": [200, 250], "in": [150, 250], "out": [200, 300], "smooth": false}, - [300, 200]]}, - ]}); - app.run("path.set", json!({"name": "Path 1", "path": doc_path})).unwrap(); - app.ui.selected_path = Some("Path 1".into()); - click(&mut app, [200.0, 250.0], Modifiers::NONE); - let (square, n) = (path(&app).subpaths[0].clone(), steps(&app)); - drag(&mut app, [200.0, 300.0], [220.0, 330.0], Modifiers::ALT); - assert_eq!(path(&app).subpaths[0], square, "the square's top edge is not bent"); - assert_eq!(knot(&app, 1, 1).out_ctrl, Point::new(220.0, 330.0)); - assert_eq!(knot(&app, 1, 1).in_ctrl, Point::new(150.0, 250.0)); - assert_eq!(steps(&app), n + 1); -} diff --git a/crates/ui-egui/src/tools/anchor_tools/tests.rs b/crates/ui-egui/src/tools/anchor_tools/tests.rs index 621a8fc0fe..6886094b45 100644 --- a/crates/ui-egui/src/tools/anchor_tools/tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/tests.rs @@ -63,7 +63,7 @@ fn add_on_a_straight_segment_inserts_a_smooth_anchor_in_one_step() { } #[test] -fn delete_removes_the_clicked_anchor_and_alt_swaps_the_tools() { +fn delete_removes_the_clicked_anchor_and_alt_makes_it_add() { let mut app = app(Tool::DeleteAnchorPoint); with_path(&mut app); let n = steps(&app); @@ -72,15 +72,15 @@ fn delete_removes_the_clicked_anchor_and_alt_swaps_the_tools() { assert_eq!((p.subpaths[0].knots.len(), p.subpaths[0].closed), (3, true)); assert_eq!(p.subpaths[0].knots[2].anchor, Point::new(40.0, 120.0)); assert_eq!(app.session.active().unwrap().history.undo_label(), Some("Delete Anchor Point")); - // ⌥ with Delete adds; ⌥ with Add deletes. + // ⌥ with Delete adds; ⌥ with Add takes the whole subpath and never deletes (#12709). click(&mut app, [80.0, 120.0], Modifiers::ALT); assert_eq!(work(&app).subpaths[0].knots.len(), 3, "the bottom edge is gone; ⌥ on empty canvas adds nothing"); click(&mut app, [40.0, 80.0], Modifiers::ALT); assert_eq!(work(&app).subpaths[0].knots.len(), 4); app.ui.tool = Tool::AddAnchorPoint; click(&mut app, [40.0, 80.0], Modifiers::ALT); - assert_eq!(work(&app).subpaths[0].knots.len(), 3); - assert_eq!(steps(&app), n + 3); + assert_eq!(work(&app).subpaths[0].knots.len(), 4, "⌥ with Add on an anchor deletes nothing"); + assert_eq!(steps(&app), n + 2); } #[test] diff --git a/crates/ui-egui/src/tools/direct_select/edits.rs b/crates/ui-egui/src/tools/direct_select/edits.rs index b8974b2083..c89884cf07 100644 --- a/crates/ui-egui/src/tools/direct_select/edits.rs +++ b/crates/ui-egui/src/tools/direct_select/edits.rs @@ -347,6 +347,9 @@ mod add_anchor_delete_key_tests; #[path = "../anchor_tools/add_anchor_lock_tests.rs"] mod add_anchor_lock_tests; #[cfg(test)] +#[path = "../anchor_tools/add_anchor_select_tests.rs"] +mod add_anchor_select_tests; +#[cfg(test)] #[path = "../anchor_tools/add_anchor_targeted_path_tests.rs"] mod add_anchor_targeted_path_tests; #[cfg(test)] From 1fe8c7bea7ed0b4e16b162690887828e70b9921b Mon Sep 17 00:00:00 2001 From: David Mann Date: Thu, 19 Nov 2026 19:13:55 +0100 Subject: [PATCH 14/17] Add Anchor Point: pin craft-libs at the merge of storytold/craft-libs#2284 (#12709) Moves every craft-libs pin at 04ba41419b to 815e6a2389 on next, which brings Add Anchor Point's Alt handling in the overlay (craft-libs#2284). The Alt tests now drive the tool through the canvas; they and the updated test that expected Add Anchor Point + Alt to delete an anchor fail with the old pin. craft-svg keeps its own rev. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 354 +++++++++--------- Cargo.toml | 68 ++-- crates/engine/Cargo.toml | 2 +- .../anchor_tools/add_anchor_alt_tests.rs | 116 +----- .../ui-egui/src/tools/anchor_tools/tests.rs | 8 +- .../ui-egui/src/tools/direct_select/edits.rs | 3 + 6 files changed, 239 insertions(+), 312 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4465866385..49395142ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1365,7 +1365,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-automation", "craft-behavior", @@ -1404,7 +1404,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "crc32fast", "flate2", @@ -1425,7 +1425,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "rustix 1.1.5", ] @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "base64 0.22.1", "craft-ai-agents", @@ -1459,7 +1459,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1475,7 +1475,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-docpath", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "egui", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "md-5", "rayon", @@ -1510,7 +1510,7 @@ dependencies = [ [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-cms", @@ -1530,29 +1530,21 @@ dependencies = [ [[package]] name = "craft-crs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "thiserror 2.0.21", ] [[package]] name = "craft-crw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "thiserror 2.0.21", ] -[[package]] -name = "craft-dds" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" -dependencies = [ - "rayon", -] - [[package]] name = "craft-dds" version = "0.1.0" @@ -1561,10 +1553,18 @@ dependencies = [ "rayon", ] +[[package]] +name = "craft-dds" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +dependencies = [ + "rayon", +] + [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "block2 0.6.2", "craft-atomic", @@ -1587,7 +1587,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "serde", ] @@ -1595,7 +1595,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1614,21 +1614,21 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" [[package]] name = "craft-file-formats" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-eps", "craft-idml", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-kra", "craft-ora", "craft-pcraft-bundle", "craft-raw", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-zip", "serde", "serde_json", @@ -1637,7 +1637,7 @@ dependencies = [ [[package]] name = "craft-flags" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-atomic", "dirs", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1662,7 +1662,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1681,7 +1681,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "cap-primitives", "craft-atomic", @@ -1702,12 +1702,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" [[package]] name = "craft-heif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "heic-rs", "rayon", @@ -1716,7 +1716,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1729,7 +1729,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "chrono", "fixed_decimal", @@ -1757,41 +1757,13 @@ dependencies = [ [[package]] name = "craft-idml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-zip", "thiserror 2.0.21", ] -[[package]] -name = "craft-image-codecs" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" -dependencies = [ - "craft-dds 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-heif", - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "crc32fast", - "exr", - "flate2", - "half", - "hayro-jpeg2000", - "image", - "image-webp", - "jpeg-encoder", - "png 0.18.1", - "rayon", - "serde_json", - "thiserror 2.0.21", - "tiff", - "zune-core", - "zune-jpeg", - "zune-jpegxl", -] - [[package]] name = "craft-image-codecs" version = "0.1.0" @@ -1819,10 +1791,38 @@ dependencies = [ "zune-jpegxl", ] +[[package]] +name = "craft-image-codecs" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +dependencies = [ + "craft-dds 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-heif", + "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "crc32fast", + "exr", + "flate2", + "half", + "hayro-jpeg2000", + "image", + "image-webp", + "jpeg-encoder", + "png 0.18.1", + "rayon", + "serde_json", + "thiserror 2.0.21", + "tiff", + "zune-core", + "zune-jpeg", + "zune-jpegxl", +] + [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1845,7 +1845,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=e7873217287876f76a0455 [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ "thiserror 2.0.21", ] @@ -1853,7 +1853,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "thiserror 2.0.21", ] @@ -1861,11 +1861,11 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-host", "craft-i18n", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "egui", "serde", "serde_json", @@ -1874,9 +1874,9 @@ dependencies = [ [[package]] name = "craft-kra" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-zip", "thiserror 2.0.21", ] @@ -1884,7 +1884,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-i18n", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -1913,18 +1913,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "craft-metadata" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" -dependencies = [ - "brotli-decompressor 6.3.2", - "chrono", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "quick-xml 0.41.0", - "serde", -] - [[package]] name = "craft-metadata" version = "0.1.0" @@ -1937,12 +1925,24 @@ dependencies = [ "serde", ] +[[package]] +name = "craft-metadata" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +dependencies = [ + "brotli-decompressor 6.3.2", + "chrono", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "quick-xml 0.41.0", + "serde", +] + [[package]] name = "craft-ora" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-zip", "thiserror 2.0.21", ] @@ -1950,7 +1950,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-text", @@ -1964,7 +1964,7 @@ dependencies = [ [[package]] name = "craft-pcraft-bundle" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "blake3", "craft-atomic", @@ -1977,7 +1977,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "serde", @@ -1988,7 +1988,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bytemuck", "flate2", @@ -2003,7 +2003,7 @@ dependencies = [ [[package]] name = "craft-pdn" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2012,7 +2012,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "async-channel", "async-io", @@ -2038,7 +2038,7 @@ dependencies = [ [[package]] name = "craft-plist" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "thiserror 2.0.21", ] @@ -2046,7 +2046,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-ui", @@ -2064,7 +2064,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "encoding_rs", "flate2", @@ -2075,7 +2075,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "dispatch2", "egui", @@ -2086,12 +2086,12 @@ dependencies = [ [[package]] name = "craft-raw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "chrono", "craft-crw", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "jxl-oxide", "miniz_oxide 0.9.1", "rayon", @@ -2104,7 +2104,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -2121,7 +2121,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-atomic", "craft-host", @@ -2132,23 +2132,6 @@ dependencies = [ "toml_edit", ] -[[package]] -name = "craft-svg" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" -dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", - "flate2", - "kurbo 0.13.1", - "quick-xml 0.41.0", - "resvg 0.48.1", - "roxmltree 0.21.2", - "thiserror 2.0.21", - "usvg 0.48.1", - "vectorcraft-geom", - "vectorcraft-pathops", -] - [[package]] name = "craft-svg" version = "0.1.0" @@ -2170,10 +2153,27 @@ dependencies = [ "vectorcraft-pathops", ] +[[package]] +name = "craft-svg" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +dependencies = [ + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "flate2", + "kurbo 0.13.1", + "quick-xml 0.41.0", + "resvg 0.48.1", + "roxmltree 0.21.2", + "thiserror 2.0.21", + "usvg 0.48.1", + "vectorcraft-geom", + "vectorcraft-pathops", +] + [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-keymap", @@ -2185,7 +2185,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2208,7 +2208,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bitflags 2.13.2", "ecolor", @@ -2221,7 +2221,7 @@ dependencies = [ [[package]] name = "craft-theme-editor" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-theme", @@ -2232,7 +2232,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-atomic", "craft-behavior", @@ -2247,7 +2247,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ "serde", "thiserror 2.0.21", @@ -2256,7 +2256,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "serde", "thiserror 2.0.21", @@ -2265,7 +2265,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "serde", "thiserror 2.0.21", @@ -2274,7 +2274,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-keymap", @@ -2289,7 +2289,7 @@ dependencies = [ [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-i18n", @@ -2319,7 +2319,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "accesskit", "craft-behavior", @@ -2331,7 +2331,7 @@ dependencies = [ "craft-platform", "craft-quit", "craft-settings", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-theme", "craft-ui-macros", "craft-window", @@ -2353,7 +2353,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2364,7 +2364,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -2382,7 +2382,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -2403,13 +2403,13 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", "craft-i18n", "craft-platform", - "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-theme", "craft-ui-macros", "craft-ui-panels", @@ -2422,7 +2422,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-behavior", "craft-host", @@ -2439,7 +2439,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "chrono", "craft-host", @@ -2468,7 +2468,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "winsafe", ] @@ -2476,7 +2476,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "craft-atomic", "craft-behavior", @@ -2506,22 +2506,12 @@ dependencies = [ [[package]] name = "craft-xcf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "thiserror 2.0.21", ] -[[package]] -name = "craft-xml" -version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" -dependencies = [ - "quick-xml 0.41.0", - "serde", - "thiserror 2.0.21", -] - [[package]] name = "craft-xml" version = "0.1.0" @@ -2532,10 +2522,20 @@ dependencies = [ "thiserror 2.0.21", ] +[[package]] +name = "craft-xml" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +dependencies = [ + "quick-xml 0.41.0", + "serde", + "thiserror 2.0.21", +] + [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "thiserror 2.0.21", @@ -3998,7 +3998,7 @@ dependencies = [ [[package]] name = "hayro" version = "0.7.1" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bytemuck", "hayro-interpret", @@ -4028,7 +4028,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -4046,7 +4046,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -4070,7 +4070,7 @@ checksum = "bc2d80da85f31c3fdc0366431f44cfd645a9da1e242ed1f4a61f213d9765660f" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "flate2", "hayro-ccitt", @@ -5154,7 +5154,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "arrayvec", "kurbo 0.13.1", @@ -6371,10 +6371,10 @@ dependencies = [ "core-graphics2", "craft", "craft-cms", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", "craft-update", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "eframe", "egui", "egui_kittest", @@ -6418,7 +6418,7 @@ name = "photocraft-algo" version = "0.23.1" dependencies = [ "craft", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "criterion", "photocraft-color", "photocraft-geom", @@ -6438,7 +6438,7 @@ dependencies = [ "cap-std", "clap", "craft", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-psd", "getrandom 0.3.4", "photocraft-color", @@ -6471,7 +6471,7 @@ dependencies = [ "clap_mangen", "craft", "craft-cms", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-psd", "photocraft-automation", "photocraft-doc", @@ -6535,11 +6535,11 @@ dependencies = [ "craft-affinity", "craft-cms", "craft-file-formats", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-pcraft-format", "craft-print", "craft-psd", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "exr", "flate2", "photocraft-algo", @@ -6575,7 +6575,7 @@ name = "photocraft-format" version = "0.23.1" dependencies = [ "blake3", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-pcraft-bundle", "craft-pcraft-format", "craft-zip", @@ -6635,16 +6635,16 @@ dependencies = [ "craft-crs", "craft-docpath", "craft-file-formats", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-kra", "craft-ora", "craft-pdf", "craft-pdn", "craft-psd", "craft-svg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-xcf", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "crc32fast", "flate2", "kurbo 0.13.1", @@ -6743,7 +6743,7 @@ dependencies = [ name = "photocraft-raw" version = "0.23.1" dependencies = [ - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-raw", "flate2", "image", @@ -6805,7 +6805,7 @@ dependencies = [ "craft", "craft-file-formats", "craft-i18n", - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-print", "craft-psd", "eframe", @@ -6854,7 +6854,7 @@ dependencies = [ name = "photocraft-web" version = "0.23.1" dependencies = [ - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "craft-psd", "eframe", "egui", @@ -11224,14 +11224,14 @@ source = "git+https://github.com/storytold/egui.git?rev=e9711ca9b69772f875ae0d1c [[patch.unused]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" [[patch.unused]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" [[patch.unused]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=04ba41419b99967e4d2b990cdfe5d80184be64ee#04ba41419b99967e4d2b990cdfe5d80184be64ee" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" diff --git a/Cargo.toml b/Cargo.toml index 5d271814fe..1f55ba2b82 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,19 +12,19 @@ rust-version = "1.95" [workspace.dependencies] # The craft framework through its facade (`craft::ui::…`). The egui `[patch]` below must match # `craft::egui_fork::REV` (checked by `cargo xtask ci`). -craft = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee", default-features = false } +craft = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5", default-features = false } # internal photocraft-geom = { path = "crates/geom" } photocraft-color = { path = "crates/color" } photocraft-raster = { path = "crates/raster" } photocraft-doc = { path = "crates/doc" } photocraft-ops = { path = "crates/ops" } -craft-plist = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -photocraft-codecs = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -photocraft-formats = { package = "craft-file-formats", git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee", features = ["raster-codecs", "pdf", "svg", "ora", "kra", "xcf", "pdn", "raw", "psd", "affinity", "pcraft"] } +craft-plist = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +photocraft-codecs = { package = "craft-image-codecs", git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +photocraft-formats = { package = "craft-file-formats", git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5", features = ["raster-codecs", "pdf", "svg", "ora", "kra", "xcf", "pdn", "raw", "psd", "affinity", "pcraft"] } photocraft-raw = { path = "crates/raw" } -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } photocraft-compose = { path = "crates/compose" } photocraft-gpu = { path = "crates/gpu" } photocraft-paint = { path = "crates/paint" } @@ -43,34 +43,34 @@ photocraft-ipp = { path = "crates/ipp" } # external # ICC colour management: the shared crate (replaces crates/cms; craft-libs#779). -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-print = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-print = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # HEIC/HEIF: the shared decoder (replaces crates/heif; craft-libs#784). -craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee", features = ["raster", "write-raster"] } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-pcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-pcraft-bundle = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-ora = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-kra = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-xcf = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-pdn = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-heif = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5", features = ["raster", "write-raster"] } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-jpeg = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-pcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-pcraft-bundle = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-ora = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-kra = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-xcf = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-pdn = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # Keep the shared embedded-image validation API until the framework revision includes it. craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "7b8c1eccea0c695a495ab279c9523e6efcc9b8be", features = ["tree-render", "tree-render-system-fonts"] } -craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-raw = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # Camera-field EXIF reader/writer, shared prerequisite craft-libs#1563. -craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -craft-crs = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-metadata = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +craft-crs = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # Interface translations: lookup, fallback, CLDR plurals and language names over the craft-i18n # catalogs that `crates/ui-egui/build.rs` embeds from `CRAFT_I18N_DIR` (storytold/craft-i18n, at # the commit in `craft-i18n.rev`). Already in the tree through craft. -craft-i18n = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-i18n = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } # craft-update: app-specific pretend versions apply to startup and manual checks. -craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee", features = ["ui"] } +craft-update = { git = "https://github.com/storytold/craft-libs", version = "=0.1.0", rev = "815e6a2389559226232a582846f9164e4dab0ea5", features = ["ui"] } thiserror = "2" serde = { version = "1", features = ["derive", "rc"] } serde_json = "1" @@ -335,14 +335,14 @@ opt-level = 3 # Keep the complete egui family and native event bridge on reviewed fork commits. [patch.crates-io] -krilla = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "e9711ca9b69772f875ae0d1cef1977ff8c16234d" } emath = { git = "https://github.com/storytold/egui.git", rev = "e9711ca9b69772f875ae0d1cef1977ff8c16234d" } epaint = { git = "https://github.com/storytold/egui.git", rev = "e9711ca9b69772f875ae0d1cef1977ff8c16234d" } diff --git a/crates/engine/Cargo.toml b/crates/engine/Cargo.toml index b28eeb44cd..e1e4c7654b 100644 --- a/crates/engine/Cargo.toml +++ b/crates/engine/Cargo.toml @@ -16,7 +16,7 @@ photocraft-geom = { workspace = true } photocraft-color = { workspace = true } craft-cms = { workspace = true } # PCTIP codec from craft-libs#1564; isolated pin until the shared revision is adopted workspace-wide. -craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "04ba41419b99967e4d2b990cdfe5d80184be64ee" } +craft-pcraft-tip = { package = "craft-pcraft-format", git = "https://github.com/storytold/craft-libs", rev = "815e6a2389559226232a582846f9164e4dab0ea5" } photocraft-raster = { workspace = true } photocraft-doc = { workspace = true } photocraft-ops = { workspace = true } diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs index 0b57b723fc..8e16824519 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_alt_tests.rs @@ -1,6 +1,7 @@ //! #12709: ⌥ with Add Anchor Point works on a whole subpath, as in the reference application. An //! ⌥-click on a segment selects the subpath and records nothing; an ⌥-drag on a segment copies the //! subpath and moves the copy (one step, Drag Path). ⌥ never turns the tool into Delete Anchor Point. +//! The overlay reports these edits (craft-libs#2284); these tests check what PhotoCraft makes of them. use egui::Modifiers; use photocraft_doc::vector::Path; @@ -10,14 +11,14 @@ use serde_json::json; use super::add_anchor_lock_tests::click_with_modifiers; use super::delete_anchor_targeted_path_tests::{select_layer, setup, shape_path, steps}; use crate::PhotocraftApp; -use crate::canvas::{ToolEvent, tool_event}; +use crate::canvas::testing; use crate::direct_select::PathRef; use crate::state::Tool; /// The epic's test document: the saved path "Path 1", targeted in the Paths panel, with the closed /// square A (100,300)-(300,500), the open line B (400,300)→(700,300) and the open S-curve C /// (400,450)→(700,450). -fn path_one() -> PhotocraftApp { +fn path_one() -> Box { let (mut app, _) = setup(Tool::AddAnchorPoint); let path = json!({"subpaths": [ {"closed": true, "knots": [[100, 300], [300, 300], [300, 500], [100, 500]]}, @@ -37,11 +38,16 @@ fn undo_label(app: &PhotocraftApp) -> Option<&str> { app.session.active().unwrap().history.undo_label() } +/// The canvas maps screen points in f32, so a drag lands within a hundredth of a pixel. +fn near(got: Point, want: [f64; 2], what: &str) { + assert!((got.x - want[0]).abs() < 0.01 && (got.y - want[1]).abs() < 0.01, "{what}: got ({}, {}), want {want:?}", got.x, got.y); +} + fn drag(app: &mut PhotocraftApp, from: [f64; 2], to: [f64; 2], mods: Modifiers) { - tool_event(app, ToolEvent::Down { x: from[0], y: from[1], pressure: 1.0 }, mods); - tool_event(app, ToolEvent::Move { x: (from[0] + to[0]) / 2.0, y: (from[1] + to[1]) / 2.0, pressure: 1.0 }, mods); - tool_event(app, ToolEvent::Move { x: to[0], y: to[1], pressure: 1.0 }, mods); - tool_event(app, ToolEvent::Up { x: to[0], y: to[1] }, mods); + testing::press(app, from, mods); + testing::move_to(app, [(from[0] + to[0]) / 2.0, (from[1] + to[1]) / 2.0], mods); + testing::move_to(app, to, mods); + testing::release(app, to, mods); } #[test] @@ -69,9 +75,10 @@ fn alt_drag_on_a_segment_copies_the_subpath_and_moves_the_copy_in_one_drag_path_ assert_eq!(p.subpaths[..3], before.subpaths[..], "A, B and C stay where they were"); let copy = &p.subpaths[3]; assert!(!copy.closed); - assert_eq!(copy.knots[0].anchor, Point::new(400.0, 500.0)); - assert_eq!(copy.knots[1].anchor, Point::new(700.0, 500.0)); - assert_eq!((copy.knots[0].out_ctrl, copy.knots[1].in_ctrl), (Point::new(500.0, 400.0), Point::new(600.0, 600.0)), "handles move with the copy"); + near(copy.knots[0].anchor, [400.0, 500.0], "the copy's first anchor"); + near(copy.knots[1].anchor, [700.0, 500.0], "the copy's last anchor"); + near(copy.knots[0].out_ctrl, [500.0, 400.0], "handles move with the copy"); + near(copy.knots[1].in_ctrl, [600.0, 600.0], "handles move with the copy"); assert_eq!(steps(&app), n + 1); assert_eq!(undo_label(&app), Some("Drag Path")); assert_eq!(app.ui.direct_selection.anchors, vec![[3, 0], [3, 1]], "the copy is selected"); @@ -126,93 +133,10 @@ fn alt_drag_copies_a_subpath_of_the_active_shape_layer() { assert_eq!(after["subpaths"].as_array().map(Vec::len), Some(2), "{after}"); assert_eq!(json_anchors(&after, 0), json_anchors(&before, 0), "the original stays"); let moved: Vec<[f64; 2]> = json_anchors(&before, 0).into_iter().map(|[x, y]| [x, y - 40.0]).collect(); - assert_eq!(json_anchors(&after, 1), moved); + assert_eq!(json_anchors(&after, 1).len(), moved.len()); + for (got, want) in json_anchors(&after, 1).into_iter().zip(moved) { + near(Point::new(got[0], got[1]), want, "the copy moved up 40 px"); + } assert_eq!(steps(&app), n + 1); assert_eq!(undo_label(&app), Some("Drag Path")); } - -#[test] -fn alt_shows_no_anchor_to_add_and_the_plus_badge_everywhere() { - let mut app = path_one(); - for at in [[200.0, 300.0], [200.0, 400.0]] { - app.hover_doc = Some(at); - assert_eq!(crate::canvas::tool_feedback::badge(&app, Tool::AddAnchorPoint, Modifiers::ALT), Some(crate::canvas::tool_feedback::Badge::Add), "{at:?}"); - } - assert_eq!(crate::anchor_tools::effective(Tool::AddAnchorPoint, Modifiers::ALT), Some(Tool::AddAnchorPoint)); - assert_eq!(crate::anchor_tools::effective(Tool::DeleteAnchorPoint, Modifiers::ALT), Some(Tool::AddAnchorPoint)); -} - -#[test] -fn letting_go_of_alt_before_the_drag_starts_still_duplicates_the_subpath() { - // Through the real canvas: the tool sees the press only once egui recognises the drag, so the - // keys held at the press decide, as for the selection tools (CodeRabbit on #13977). - use egui::{Pos2, Rect, vec2}; - let ctx = egui::Context::default(); - let mut app = path_one(); - app.run("view.actualPixels", json!({})).unwrap(); - app.sync_views(); - let mut view = app.ui.views[0].clone(); - view.zoom = 1.0; - view.center = [400.0, 300.0]; - view.fit_pending = false; - view.fill_pending = false; - let rect = Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0)); - let frame = |app: &mut PhotocraftApp, events: Vec| { - let input = egui::RawInput { screen_rect: Some(rect), events, ..Default::default() }; - let mut out = ctx.run_ui(input, |ui| { - crate::canvas::canvas_view(app, ui, 0, rect, view.clone(), true); - }); - out.textures_delta.clear(); - }; - let press = |pos: Pos2, pressed: bool, modifiers: Modifiers| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers }; - let (alt, none) = (Modifiers::ALT, Modifiers::NONE); - let (before, n) = (path(&app), steps(&app)); - // C's middle, (550,450) in the document, is the same screen point at 100 % centred on the document. - let start = Pos2::new(550.0, 450.0); - frame(&mut app, vec![egui::Event::ModifiersChanged(alt), egui::Event::PointerMoved(start)]); - frame(&mut app, vec![press(start, true, alt)]); - frame(&mut app, vec![egui::Event::ModifiersChanged(none), egui::Event::PointerMoved(start + vec2(0.0, 25.0))]); - frame(&mut app, vec![egui::Event::PointerMoved(start + vec2(0.0, 50.0))]); - frame(&mut app, vec![press(start + vec2(0.0, 50.0), false, none)]); - let p = path(&app); - assert_eq!(p.subpaths.len(), 4, "the subpath was copied, no anchor added: {:?}", p.subpaths.iter().map(|s| s.knots.len()).collect::>()); - assert_eq!(p.subpaths[..3], before.subpaths[..]); - assert_eq!((p.subpaths[3].knots[0].anchor, p.subpaths[3].knots[1].anchor), (Point::new(400.0, 500.0), Point::new(700.0, 500.0))); - assert_eq!((steps(&app), undo_label(&app)), (n + 1, Some("Drag Path"))); -} - -#[test] -fn letting_go_of_alt_before_the_click_ends_still_selects_the_subpath() { - // Through the real canvas: a click is replayed on release, so the keys held at the press - // decide, as for Object Selection (CodeRabbit on #13977). - use egui::{Pos2, Rect, vec2}; - let ctx = egui::Context::default(); - let mut app = path_one(); - app.run("view.actualPixels", json!({})).unwrap(); - app.sync_views(); - let mut view = app.ui.views[0].clone(); - view.zoom = 1.0; - view.center = [400.0, 300.0]; - view.fit_pending = false; - view.fill_pending = false; - let rect = Rect::from_min_size(Pos2::ZERO, vec2(800.0, 600.0)); - let frame = |app: &mut PhotocraftApp, events: Vec| { - let input = egui::RawInput { screen_rect: Some(rect), events, ..Default::default() }; - let mut out = ctx.run_ui(input, |ui| { - crate::canvas::canvas_view(app, ui, 0, rect, view.clone(), true); - }); - out.textures_delta.clear(); - }; - let press = |pos: Pos2, pressed: bool, modifiers: Modifiers| egui::Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers }; - let (alt, none) = (Modifiers::ALT, Modifiers::NONE); - let (before, n) = (path(&app), steps(&app)); - // A's top edge, (200,300) in the document. - let at = Pos2::new(200.0, 300.0); - frame(&mut app, vec![egui::Event::ModifiersChanged(alt), egui::Event::PointerMoved(at)]); - frame(&mut app, vec![press(at, true, alt)]); - frame(&mut app, vec![egui::Event::ModifiersChanged(none)]); - frame(&mut app, vec![press(at, false, none)]); - frame(&mut app, vec![]); - assert_eq!((path(&app), steps(&app)), (before, n), "no anchor added, no History step"); - assert_eq!(app.ui.direct_selection.anchors, vec![[0, 0], [0, 1], [0, 2], [0, 3]], "A's four anchors"); -} diff --git a/crates/ui-egui/src/tools/anchor_tools/tests.rs b/crates/ui-egui/src/tools/anchor_tools/tests.rs index 621a8fc0fe..6886094b45 100644 --- a/crates/ui-egui/src/tools/anchor_tools/tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/tests.rs @@ -63,7 +63,7 @@ fn add_on_a_straight_segment_inserts_a_smooth_anchor_in_one_step() { } #[test] -fn delete_removes_the_clicked_anchor_and_alt_swaps_the_tools() { +fn delete_removes_the_clicked_anchor_and_alt_makes_it_add() { let mut app = app(Tool::DeleteAnchorPoint); with_path(&mut app); let n = steps(&app); @@ -72,15 +72,15 @@ fn delete_removes_the_clicked_anchor_and_alt_swaps_the_tools() { assert_eq!((p.subpaths[0].knots.len(), p.subpaths[0].closed), (3, true)); assert_eq!(p.subpaths[0].knots[2].anchor, Point::new(40.0, 120.0)); assert_eq!(app.session.active().unwrap().history.undo_label(), Some("Delete Anchor Point")); - // ⌥ with Delete adds; ⌥ with Add deletes. + // ⌥ with Delete adds; ⌥ with Add takes the whole subpath and never deletes (#12709). click(&mut app, [80.0, 120.0], Modifiers::ALT); assert_eq!(work(&app).subpaths[0].knots.len(), 3, "the bottom edge is gone; ⌥ on empty canvas adds nothing"); click(&mut app, [40.0, 80.0], Modifiers::ALT); assert_eq!(work(&app).subpaths[0].knots.len(), 4); app.ui.tool = Tool::AddAnchorPoint; click(&mut app, [40.0, 80.0], Modifiers::ALT); - assert_eq!(work(&app).subpaths[0].knots.len(), 3); - assert_eq!(steps(&app), n + 3); + assert_eq!(work(&app).subpaths[0].knots.len(), 4, "⌥ with Add on an anchor deletes nothing"); + assert_eq!(steps(&app), n + 2); } #[test] diff --git a/crates/ui-egui/src/tools/direct_select/edits.rs b/crates/ui-egui/src/tools/direct_select/edits.rs index b8974b2083..19091676ed 100644 --- a/crates/ui-egui/src/tools/direct_select/edits.rs +++ b/crates/ui-egui/src/tools/direct_select/edits.rs @@ -340,6 +340,9 @@ fn edit_draft(app: &mut PhotocraftApp, edit: impl FnOnce(&mut EditPath) -> bool) } } +#[cfg(test)] +#[path = "../anchor_tools/add_anchor_alt_tests.rs"] +mod add_anchor_alt_tests; #[cfg(test)] #[path = "../anchor_tools/add_anchor_delete_key_tests.rs"] mod add_anchor_delete_key_tests; From 34276a0a72bfcda2c596b66d923b460ca10b1026 Mon Sep 17 00:00:00 2001 From: David Mann Date: Thu, 19 Nov 2026 19:29:12 +0100 Subject: [PATCH 15/17] Add Anchor Point: drive the handle-pull tests through the canvas (#12707) The drag moved into the shared overlay (storytold/craft-libs#2285, not merged yet, which adds PathEdit::PullAnchor for PhotoCraft to map). The tests now click through the canvas; the ones that need the pull are ignored until the craft-libs pin carries it. The plain-click neighbour runs now. Co-Authored-By: Claude Opus 5.5 --- .../anchor_tools/add_anchor_drag_tests.rs | 148 +++--------------- .../ui-egui/src/tools/direct_select/edits.rs | 3 + 2 files changed, 22 insertions(+), 129 deletions(-) diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs index 6503ee357c..edeab9026d 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs @@ -1,7 +1,8 @@ //! #12707: a drag from a segment with Add Anchor Point inserts the anchor and pulls out its //! handles, as the Pen does: the outgoing handle follows the pointer and the incoming one mirrors -//! it. ⇧ turns the handle to 45°, ⌥ breaks the pair, Space moves the anchor; the add and the drag -//! are one history step, Add Anchor Point. +//! it. ⇧ turns the handle to 45°, ⌥ breaks the pair; the add and the drag are one history step, +//! Add Anchor Point. The drag is the overlay's (`PathEdit::PullAnchor`, storytold/craft-libs#2285); +//! the tests that need it stay ignored until the craft-libs pin carries it and PhotoCraft maps it. use egui::Modifiers; use photocraft_doc::Knot; @@ -9,13 +10,13 @@ use photocraft_geom::Point; use serde_json::json; use crate::PhotocraftApp; -use crate::canvas::{ToolEvent, tool_event}; +use crate::canvas::testing; use crate::direct_select::PathRef; use crate::state::Tool; /// 600 x 600 with the closed corner square (100,300) (300,300) (300,500) (100,500) as the saved /// path "Path 1", selected in the Paths panel, and Add Anchor Point picked. -fn square() -> PhotocraftApp { +fn square() -> Box { let mut app = PhotocraftApp::new(photocraft_engine::Session::new(), crate::Services::default()); app.session.execute("file.new", json!({"width": 600, "height": 600})).unwrap(); app.sync_views(); @@ -40,15 +41,15 @@ fn undo_label(app: &PhotocraftApp) -> Option { } fn down(app: &mut PhotocraftApp, at: [f64; 2]) { - tool_event(app, ToolEvent::Down { x: at[0], y: at[1], pressure: 1.0 }, Modifiers::NONE); + testing::press(app, at, Modifiers::NONE); } fn to(app: &mut PhotocraftApp, at: [f64; 2], mods: Modifiers) { - tool_event(app, ToolEvent::Move { x: at[0], y: at[1], pressure: 1.0 }, mods); + testing::move_to(app, at, mods); } fn up(app: &mut PhotocraftApp, at: [f64; 2], mods: Modifiers) { - tool_event(app, ToolEvent::Up { x: at[0], y: at[1] }, mods); + testing::release(app, at, mods); } /// The knot at `anchor` (within a pixel) on `path`. @@ -64,6 +65,7 @@ fn assert_knot(k: &Knot, anchor: [f64; 2], out: [f64; 2], inc: [f64; 2]) { } #[test] +#[ignore = "needs storytold/craft-libs#2285 in the craft-libs pin and its PathEdit::PullAnchor mapped"] fn a_drag_from_the_bottom_edge_pulls_out_mirrored_handles_in_one_step() { let mut app = square(); let (before, n) = (saved(&app), steps(&app)); @@ -83,6 +85,7 @@ fn a_drag_from_the_bottom_edge_pulls_out_mirrored_handles_in_one_step() { } #[test] +#[ignore = "needs storytold/craft-libs#2285 in the craft-libs pin and its PathEdit::PullAnchor mapped"] fn shift_turns_the_handle_to_45_degrees_and_the_in_handle_mirrors_it() { // The anchor goes in at (200,500); the drags are offsets from it. for (d, want) in [ @@ -103,6 +106,7 @@ fn shift_turns_the_handle_to_45_degrees_and_the_in_handle_mirrors_it() { } #[test] +#[ignore = "needs storytold/craft-libs#2285 in the craft-libs pin and its PathEdit::PullAnchor mapped"] fn alt_during_the_drag_breaks_the_pair_so_only_the_out_handle_follows() { let mut app = square(); let n = steps(&app); @@ -117,99 +121,7 @@ fn alt_during_the_drag_breaks_the_pair_so_only_the_out_handle_follows() { } #[test] -fn space_moves_the_anchor_with_its_handles_and_letting_go_returns_to_the_handle() { - let mut app = square(); - let n = steps(&app); - down(&mut app, [300.0, 400.0]); - to(&mut app, [340.0, 400.0], Modifiers::NONE); - assert!(crate::anchor_tools::set_reposition(&mut app, true), "the canvas keeps Space from panning"); - to(&mut app, [340.0, 420.0], Modifiers::NONE); - to(&mut app, [340.0, 440.0], Modifiers::NONE); - crate::anchor_tools::set_reposition(&mut app, false); - to(&mut app, [352.0, 440.0], Modifiers::NONE); - up(&mut app, [352.0, 440.0], Modifiers::NONE); - let k = knot_at(&saved(&app), [300.0, 440.0]); - assert_knot(&k, [300.0, 440.0], [352.0, 440.0], [248.0, 440.0]); - assert_eq!((steps(&app), undo_label(&app).as_deref()), (n + 1, Some("Add Anchor Point"))); - assert!(!crate::anchor_tools::set_reposition(&mut app, true), "no drag, nothing to reposition"); -} - -/// A pull whose anchor Space moved is kept when the pointer comes back to the press point before -/// the release: the release is not a click. -#[test] -fn space_moves_are_kept_when_the_pointer_returns_to_the_press() { - let mut app = square(); - down(&mut app, [300.0, 400.0]); - to(&mut app, [340.0, 400.0], Modifiers::NONE); - crate::anchor_tools::set_reposition(&mut app, true); - to(&mut app, [340.0, 440.0], Modifiers::NONE); - crate::anchor_tools::set_reposition(&mut app, false); - to(&mut app, [300.0, 400.0], Modifiers::NONE); - up(&mut app, [300.0, 400.0], Modifiers::NONE); - let k = knot_at(&saved(&app), [300.0, 440.0]); - assert_knot(&k, [300.0, 440.0], [300.0, 400.0], [300.0, 480.0]); -} - -/// The Space case through the real canvas: the held key reaches the drag, and the view does not pan. -#[test] -fn space_in_the_canvas_moves_the_anchor_instead_of_panning() { - use egui::{Event, Key, PointerButton, pos2}; - let mut a = square(); - a.ui.extras.rulers = false; - a.ui.views = vec![crate::state::View { - zoom: 1.0, - center: [300.0, 300.0], - fit_pending: false, - fill_pending: false, - doc_size: [600, 600], - rotation: 0.0, - zoom_animating: false, - zoom_anchor: None, - display_camera: None, - zoom_transition: None, - }]; - let mut h = egui_kittest::Harness::builder().with_size(egui::vec2(600.0, 600.0)).build_ui_state( - |ui, app: &mut PhotocraftApp| { - let v = app.ui.views[0].clone(); - crate::canvas::canvas_view(app, ui, 0, ui.max_rect(), v, true); - }, - a, - ); - h.run_steps(2); - let rect = egui::Rect::from_min_size(egui::Pos2::ZERO, egui::vec2(600.0, 600.0)); - let xf = crate::canvas::ViewXform { rect, zoom: 1.0, center: [300.0, 300.0], flip: false, rotation: 0.0, aspect: 1.0 }; - let button = |pos, pressed| Event::PointerButton { pos, button: PointerButton::Primary, pressed, modifiers: Modifiers::NONE }; - let space = |pressed| Event::Key { key: Key::Space, physical_key: None, pressed, repeat: false, modifiers: Modifiers::NONE }; - let press = xf.to_screen(300.0, 400.0); - h.event(Event::PointerMoved(press)); - h.step(); - h.event(button(press, true)); - h.step(); - let mv = |h: &mut egui_kittest::Harness<'_, PhotocraftApp>, x: f32, y: f32| { - let p = xf.to_screen(x, y); - h.event(Event::PointerMoved(pos2(p.x, p.y))); - h.step(); - }; - for x in [320.0, 340.0] { - mv(&mut h, x, 400.0); - } - h.event(space(true)); - h.step(); - for y in [420.0, 440.0] { - mv(&mut h, 340.0, y); - } - h.event(space(false)); - h.step(); - mv(&mut h, 352.0, 440.0); - let end = xf.to_screen(352.0, 440.0); - h.event(button(end, false)); - h.run_steps(2); - assert_eq!(h.state().ui.views[0].center, [300.0, 300.0], "Space did not pan"); - let k = knot_at(&saved(h.state()), [300.0, 440.0]); - assert_knot(&k, [300.0, 440.0], [352.0, 440.0], [248.0, 440.0]); -} - -#[test] +#[ignore = "needs storytold/craft-libs#2285 in the craft-libs pin and its PathEdit::PullAnchor mapped"] fn the_drag_works_on_a_shape_layers_path_in_one_step() { // 800 x 600, a shape from (450,100) to (650,250), made the active layer. let (mut app, shape) = super::delete_anchor_targeted_path_tests::setup(Tool::AddAnchorPoint); @@ -236,34 +148,12 @@ fn a_click_without_movement_keeps_the_plain_add() { let n = steps(&app); down(&mut app, [200.0, 500.0]); up(&mut app, [200.0, 500.0], Modifiers::NONE); - assert_eq!(saved(&app), want, "only the add"); + // Only the add: the canvas maps the click in f32, so the anchor lands within a hundredth of a pixel. + let got = saved(&app); + assert_eq!(got.subpaths[0].knots.len(), want.subpaths[0].knots.len(), "one anchor added"); + for (g, w) in got.subpaths[0].knots.iter().zip(&want.subpaths[0].knots) { + let near = |p: Point, q: Point| (p.x - q.x).hypot(p.y - q.y) < 0.01; + assert!(near(g.anchor, w.anchor) && near(g.in_ctrl, w.in_ctrl) && near(g.out_ctrl, w.out_ctrl) && g.smooth == w.smooth, "{g:?} vs {w:?}"); + } assert_eq!((steps(&app), undo_label(&app).as_deref()), (n + 1, Some("Add Anchor Point"))); } - -#[test] -fn non_finite_pointer_positions_leave_the_drag_alone() { - let mut app = square(); - down(&mut app, [200.0, 500.0]); - to(&mut app, [200.0, 560.0], Modifiers::NONE); - to(&mut app, [f64::NAN, f64::INFINITY], Modifiers::SHIFT); - up(&mut app, [200.0, 560.0], Modifiers::NONE); - assert_knot(&knot_at(&saved(&app), [200.0, 500.0]), [200.0, 500.0], [200.0, 560.0], [200.0, 440.0]); -} - -/// The Space case driven by an agent: `ui.pointer` with `space: true` moves the anchor. -#[test] -fn an_agents_space_moves_the_anchor() { - let mut app = square(); - let ctx = egui::Context::default(); - let pointer = |app: &mut PhotocraftApp, params: serde_json::Value| { - let (req, _rx) = crate::control::ControlRequest::new("ui.pointer", params); - match crate::control::handle(app, &ctx, &req) { - crate::control::Outcome::Done(v) => assert_eq!(v["ok"], true, "{v}"), - _ => panic!("expected an immediate reply"), - } - }; - pointer(&mut app, json!({"events": [{"kind": "down", "x": 300, "y": 400}, {"kind": "move", "x": 340, "y": 400}]})); - pointer(&mut app, json!({"space": true, "events": [{"kind": "move", "x": 340, "y": 440}]})); - pointer(&mut app, json!({"events": [{"kind": "move", "x": 352, "y": 440}, {"kind": "up", "x": 352, "y": 440}]})); - assert_knot(&knot_at(&saved(&app), [300.0, 440.0]), [300.0, 440.0], [352.0, 440.0], [248.0, 440.0]); -} diff --git a/crates/ui-egui/src/tools/direct_select/edits.rs b/crates/ui-egui/src/tools/direct_select/edits.rs index b8974b2083..5abbcae8e6 100644 --- a/crates/ui-egui/src/tools/direct_select/edits.rs +++ b/crates/ui-egui/src/tools/direct_select/edits.rs @@ -344,6 +344,9 @@ fn edit_draft(app: &mut PhotocraftApp, edit: impl FnOnce(&mut EditPath) -> bool) #[path = "../anchor_tools/add_anchor_delete_key_tests.rs"] mod add_anchor_delete_key_tests; #[cfg(test)] +#[path = "../anchor_tools/add_anchor_drag_tests.rs"] +mod add_anchor_drag_tests; +#[cfg(test)] #[path = "../anchor_tools/add_anchor_lock_tests.rs"] mod add_anchor_lock_tests; #[cfg(test)] From 60c65b4be6c2ded1d52dfc36e66577a15a6423e6 Mon Sep 17 00:00:00 2001 From: David Mann Date: Thu, 19 Nov 2026 19:48:38 +0100 Subject: [PATCH 16/17] Regenerate Cargo.lock for the craft-libs pin with cargo The pin bump had rewritten the lock by text, which mixed the entries of the two craft-libs revisions (craft-svg keeps its own). Resolved by cargo from main's lock: only the craft-libs sources change, no crate versions. Co-Authored-By: Claude Opus 5.5 --- Cargo.lock | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aeb4a93c80..49395142ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1548,7 +1548,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ "rayon", ] @@ -1556,7 +1556,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "rayon", ] @@ -1767,13 +1767,12 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ - "craft-dds 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", - "craft-heif", - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-dds 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", + "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", "crc32fast", "exr", "flate2", @@ -1795,12 +1794,13 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-dds 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", - "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", - "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", + "craft-dds 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-heif", + "craft-jpeg 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-metadata 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "crc32fast", "exr", "flate2", @@ -1845,7 +1845,7 @@ source = "git+https://github.com/storytold/craft-libs?rev=e7873217287876f76a0455 [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ "thiserror 2.0.21", ] @@ -1853,7 +1853,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "thiserror 2.0.21", ] @@ -1916,11 +1916,11 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ "brotli-decompressor 6.3.2", "chrono", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", "quick-xml 0.41.0", "serde", ] @@ -1928,11 +1928,11 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "brotli-decompressor 6.3.2", "chrono", - "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", + "craft-tiff 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "quick-xml 0.41.0", "serde", ] @@ -2135,10 +2135,14 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", + "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", + "data-url", "flate2", + "gif", + "image-webp", "kurbo 0.13.1", "quick-xml 0.41.0", "resvg 0.48.1", @@ -2152,14 +2156,10 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ - "craft-image-codecs 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", - "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be)", - "data-url", + "craft-xml 0.1.0 (git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5)", "flate2", - "gif", - "image-webp", "kurbo 0.13.1", "quick-xml 0.41.0", "resvg 0.48.1", @@ -2247,7 +2247,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ "serde", "thiserror 2.0.21", @@ -2256,7 +2256,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "serde", "thiserror 2.0.21", @@ -2515,7 +2515,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" +source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2525,7 +2525,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=7b8c1eccea0c695a495ab279c9523e6efcc9b8be#7b8c1eccea0c695a495ab279c9523e6efcc9b8be" +source = "git+https://github.com/storytold/craft-libs?rev=815e6a2389559226232a582846f9164e4dab0ea5#815e6a2389559226232a582846f9164e4dab0ea5" dependencies = [ "quick-xml 0.41.0", "serde", From 447f8b990851d95cdd40d490789ad8c6e52a7c37 Mon Sep 17 00:00:00 2001 From: David Mann Date: Sat, 21 Nov 2026 17:50:34 +0100 Subject: [PATCH 17/17] Add Anchor Point: run the handle-pull tests now that main maps PullAnchor (#12707) main carries storytold/craft-libs#2285 in its craft-libs pin and maps PathEdit::PullAnchor in direct_select/edits.rs, so the four drag tests no longer need #[ignore]; they pass on the merged tree. Co-Authored-By: Claude Opus 5.5 --- .../src/tools/anchor_tools/add_anchor_drag_tests.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs index edeab9026d..02a7cd88e9 100644 --- a/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs +++ b/crates/ui-egui/src/tools/anchor_tools/add_anchor_drag_tests.rs @@ -1,8 +1,8 @@ //! #12707: a drag from a segment with Add Anchor Point inserts the anchor and pulls out its //! handles, as the Pen does: the outgoing handle follows the pointer and the incoming one mirrors //! it. ⇧ turns the handle to 45°, ⌥ breaks the pair; the add and the drag are one history step, -//! Add Anchor Point. The drag is the overlay's (`PathEdit::PullAnchor`, storytold/craft-libs#2285); -//! the tests that need it stay ignored until the craft-libs pin carries it and PhotoCraft maps it. +//! Add Anchor Point. The drag is the overlay's (`PathEdit::PullAnchor`, storytold/craft-libs#2285), +//! mapped in `direct_select/edits.rs` (`add_and_pull`). use egui::Modifiers; use photocraft_doc::Knot; @@ -65,7 +65,6 @@ fn assert_knot(k: &Knot, anchor: [f64; 2], out: [f64; 2], inc: [f64; 2]) { } #[test] -#[ignore = "needs storytold/craft-libs#2285 in the craft-libs pin and its PathEdit::PullAnchor mapped"] fn a_drag_from_the_bottom_edge_pulls_out_mirrored_handles_in_one_step() { let mut app = square(); let (before, n) = (saved(&app), steps(&app)); @@ -85,7 +84,6 @@ fn a_drag_from_the_bottom_edge_pulls_out_mirrored_handles_in_one_step() { } #[test] -#[ignore = "needs storytold/craft-libs#2285 in the craft-libs pin and its PathEdit::PullAnchor mapped"] fn shift_turns_the_handle_to_45_degrees_and_the_in_handle_mirrors_it() { // The anchor goes in at (200,500); the drags are offsets from it. for (d, want) in [ @@ -106,7 +104,6 @@ fn shift_turns_the_handle_to_45_degrees_and_the_in_handle_mirrors_it() { } #[test] -#[ignore = "needs storytold/craft-libs#2285 in the craft-libs pin and its PathEdit::PullAnchor mapped"] fn alt_during_the_drag_breaks_the_pair_so_only_the_out_handle_follows() { let mut app = square(); let n = steps(&app); @@ -121,7 +118,6 @@ fn alt_during_the_drag_breaks_the_pair_so_only_the_out_handle_follows() { } #[test] -#[ignore = "needs storytold/craft-libs#2285 in the craft-libs pin and its PathEdit::PullAnchor mapped"] fn the_drag_works_on_a_shape_layers_path_in_one_step() { // 800 x 600, a shape from (450,100) to (650,250), made the active layer. let (mut app, shape) = super::delete_anchor_targeted_path_tests::setup(Tool::AddAnchorPoint);