From 64211808de18357274a46d7f8517d2af6eeeaea7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 16:13:48 -0800 Subject: [PATCH 01/11] Quick Pen: Ctrl+wheel over the canvas changes the arc size With the Quick Pen tool active, Ctrl with a scroll on a touchpad over the canvas (the Control key on macOS too) changes the arc size as ] and [ do: up makes it 15 degrees larger and down 15 degrees smaller, for the last sharp-corner arc and the arcs after it, also while a press drags that arc. The touchpad makes one step for each wheel line of motion within one turn, and momentum after the fingers lift makes none; the keys held at any point of a gesture count until it ends. A mouse wheel turned with Ctrl does the same, one step for each wheel event. Sideways motion makes no step. The view does not zoom or scroll for the rest of that wheel turn. The arc size stays as it is for a wheel turned over the Quick Pen toolbar, under a modal dialog, in a turn begun under one, or with Shift, Alt or Cmd held as well. - New desktop commands tool.quickPen.arcLarger and tool.quickPen.arcSmaller step the size; each returns false when the Quick Pen tool is not active or the step would leave 1 to 359 degrees. - Labels in every catalog. - The command palette test that needs a short result list searches "pen tools": the new commands also match "pen tool", which then fills all twelve rows, so the popup can no longer grow. Docs: docs/mcp.md, ROADMAP, docs/ui-parity.md, docs/target-app-parity.md. Part of #2660. --- ROADMAP.md | 1 + crates/mcp/src/ui_catalog.rs | 12 + crates/ui-egui/src/canvas.rs | 1 + crates/ui-egui/src/canvas/input.rs | 7 +- crates/ui-egui/src/canvas/quick_pen_wheel.rs | 125 ++++++ crates/ui-egui/src/i18n/bg.tsv | 2 + crates/ui-egui/src/i18n/bs.tsv | 2 + crates/ui-egui/src/i18n/ca.tsv | 2 + crates/ui-egui/src/i18n/cs.tsv | 2 + crates/ui-egui/src/i18n/da.tsv | 2 + crates/ui-egui/src/i18n/de.tsv | 2 + crates/ui-egui/src/i18n/el.tsv | 2 + crates/ui-egui/src/i18n/es.tsv | 2 + crates/ui-egui/src/i18n/fi.tsv | 2 + crates/ui-egui/src/i18n/fr.tsv | 2 + crates/ui-egui/src/i18n/gu.tsv | 2 + crates/ui-egui/src/i18n/hi.tsv | 2 + crates/ui-egui/src/i18n/hu.tsv | 2 + crates/ui-egui/src/i18n/id.tsv | 2 + crates/ui-egui/src/i18n/it.tsv | 2 + crates/ui-egui/src/i18n/ja.tsv | 2 + crates/ui-egui/src/i18n/ka.tsv | 2 + crates/ui-egui/src/i18n/ko.tsv | 2 + crates/ui-egui/src/i18n/nl.tsv | 2 + crates/ui-egui/src/i18n/pl.tsv | 2 + crates/ui-egui/src/i18n/pt-br.tsv | 2 + crates/ui-egui/src/i18n/ru.tsv | 2 + crates/ui-egui/src/i18n/sv.tsv | 2 + crates/ui-egui/src/i18n/tr.tsv | 2 + crates/ui-egui/src/i18n/uk.tsv | 2 + crates/ui-egui/src/i18n/vi.tsv | 2 + crates/ui-egui/src/i18n/zh-hans.tsv | 2 + crates/ui-egui/src/i18n/zh-hant.tsv | 2 + crates/ui-egui/src/menus/run.rs | 33 ++ crates/ui-egui/src/menus/ui_commands.rs | 12 + crates/ui-egui/src/palette.rs | 2 +- crates/ui-egui/src/tests.rs | 1 + crates/ui-egui/src/tests/quickpenwheel.rs | 407 +++++++++++++++++++ docs/mcp.md | 21 +- docs/target-app-parity.md | 2 +- docs/ui-parity.md | 2 +- 41 files changed, 672 insertions(+), 10 deletions(-) create mode 100644 crates/ui-egui/src/canvas/quick_pen_wheel.rs create mode 100644 crates/ui-egui/src/tests/quickpenwheel.rs diff --git a/ROADMAP.md b/ROADMAP.md index 90a6100167..b7ecbca46f 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -149,6 +149,7 @@ Ranked; detail in [docs/roadmap.md](docs/roadmap.md) and [docs/gaps.md](docs/gap - 2026-11-17: Circle Tool Options (double-click the Circle tool): Show Center, Show Radii and Show Diameter switch what the tool shows while a circle is drawn, Color sets the color of the center cross and radius lines, Anchors at Standard Positions off puts the circle's anchors at the points it was drawn through (`shape.circleThroughPoints {anchors: "points"}`), and Third Point by Dragging off draws a three-point circle with three clicks and a two-point circle with a double-click on the second point. A VectorCraft addition: headline numbers unchanged. - 2026-11-19: Quick Pen tool, in the Pen tool's group (Alt+P, Option+P on macOS): clicks or drags add straight lines, continuous arcs or sharp-corner arcs; Alt tapped on its own switches the action, C flips the last arc, `[` and `]` size it, a click on the first point closes the path and a click on an open end continues it (`path.quickPen`, part of #2660). Headline numbers unchanged. - 2026-11-19: Quick Pen toolbar on the canvas while the tool is active: Straight Line, Continuous Arc and Sharp Corner Arc, Flip Arc, and More Options with Hide Toolbar, Pin Toolbar Position and Reset Toolbar Position; it follows the drawing beside the path's last point and its handle drags it (`tool.quickPen.flipArc`, `window.quickPenToolbar`, Window › Quick Pen Toolbar; part of #2660). Headline numbers unchanged. +- 2026-11-19: Quick Pen arc size with Ctrl+wheel: over the canvas, a touchpad scroll or a mouse wheel turned with Ctrl makes the arc size 15° larger or smaller per step, as `]` and `[` do, and the view stays put (`tool.quickPen.arcLarger`, `tool.quickPen.arcSmaller`; part of #2660). Headline numbers unchanged. - 2026-10-31: Pattern libraries: Window › Swatch Libraries › Patterns and the Swatches panel's library menu open Geometric Patterns, a built-in library of eleven pattern swatches (dots, stripes, checks, a grid and shapes); clicking one adds its pattern and swatch to the document, once, and applies it to the active fill or stroke (`swatch.library.add`). - 2026-11-11: Pattern libraries: Patterns › Grit Textures, a second built-in pattern library, holds eight seamless black textures (Fine Grain, Coarse Grit, Sand, Speckle, Stipple, Scratches, Sparse Flecks and Dense Flecks) on tiles of 18 to 36 pt, each drawn the same way every time; marks that reach past a tile edge continue on the next tile, so the tiles join without a seam (`swatch.library.add`). Scores and estimates unchanged. - 2026-11-11: Pattern libraries: Patterns › Optical Effects, a third built-in pattern library, of VectorCraft's own designs, holds eight black wave, moiré and op-art tiles (Sine Bands, Ripple Lines, Interference Rings, Offset Rings, Warped Checks, Pinched Stripes, Chevron Pulse and Radiating Lenses) of 32 to 48 pt, each drawn the same way every time; each tile is one period of its design, and art that reaches past a tile edge continues on the next tile, so the tiles join without a seam (`swatch.library.add`). Scores and estimates unchanged. diff --git a/crates/mcp/src/ui_catalog.rs b/crates/mcp/src/ui_catalog.rs index 64c57a6798..548f10b79f 100644 --- a/crates/mcp/src/ui_catalog.rs +++ b/crates/mcp/src/ui_catalog.rs @@ -718,6 +718,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} flip the last sharp-corner arc of the path the Quick Pen tool is drawing to the other side of its chord, as C and the toolbar's Flip Arc button do, as one undo step; first finishes any pending tool edit (which can change the document), then returns false, changing nothing more, when the Quick Pen tool is not active, no path is being drawn or the last piece is not a sharp-corner arc", ), + ( + "tool.quickPen.arcLarger", + "Increase Arc Size", + "", + "{} make the Quick Pen tool's arc size 15° larger, for the last sharp-corner arc of the path being drawn and the arcs after it, as ] and Ctrl+wheel up over the canvas do; first finishes any pending tool edit (which can change the document), then returns false, changing nothing more, when the Quick Pen tool is not active or a step would take the arc size above 359°", + ), + ( + "tool.quickPen.arcSmaller", + "Decrease Arc Size", + "", + "{} make the Quick Pen tool's arc size 15° smaller, for the last sharp-corner arc of the path being drawn and the arcs after it, as [ and Ctrl+wheel down over the canvas do; first finishes any pending tool edit (which can change the document), then returns false, changing nothing more, when the Quick Pen tool is not active or a step would take the arc size below 1°", + ), ( "window.dock", "Panels", diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 8b366665d4..09dbd5e07a 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -29,6 +29,7 @@ mod outline; mod overlays; mod panes; mod quick_pen_bar; +mod quick_pen_wheel; mod raster; mod selection_marks; mod task_bar; diff --git a/crates/ui-egui/src/canvas/input.rs b/crates/ui-egui/src/canvas/input.rs index a6a0509de5..f91a29d63f 100644 --- a/crates/ui-egui/src/canvas/input.rs +++ b/crates/ui-egui/src/canvas/input.rs @@ -248,7 +248,12 @@ fn wheel_view( if carried != was_carried { ui.data_mut(|d| d.insert_temp(carried_id, carried)); } - let muted = modal || carried; + // A Ctrl-wheel turn with the Quick Pen tool changes its arc size and leaves the view alone. + // Not over a floating panel, a menu or a toolbar drawn on top of the canvas ([`on_canvas`]), and not for a + // wheel turn that went on under a modal dialog. + let over = !modal && !carried && resp.hovered() && ui.input(|i| i.pointer.hover_pos()).is_some_and(|p| on_canvas(ui, resp, p)); + let arc_turn = super::quick_pen_wheel::arc_size(app, ui, over); + let muted = modal || carried || arc_turn; let navigates = resp.hovered() && !muted; // A docked field may be drawn later and has not consumed its wheel event yet. Only canvas // hover may start a zoom glide; existing glides still decay outside the canvas in `wheel`. diff --git a/crates/ui-egui/src/canvas/quick_pen_wheel.rs b/crates/ui-egui/src/canvas/quick_pen_wheel.rs new file mode 100644 index 0000000000..6ba86ca852 --- /dev/null +++ b/crates/ui-egui/src/canvas/quick_pen_wheel.rs @@ -0,0 +1,125 @@ +//! Ctrl+wheel over the canvas with the Quick Pen tool: the arc size, in place of the view. +//! +//! Public behavior: Ctrl + scroll on a trackpad makes the arc size larger or smaller, on Windows +//! and on macOS alike +//! ([Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html)). +//! VectorCraft's own rules: a mouse wheel turned with Ctrl does the same; each wheel event from a +//! mouse wheel (one per notch) makes one step of 15°, as `[` and `]` do, and a touchpad makes one +//! step for each wheel line of its motion; up makes the arc larger and down smaller, and sideways +//! motion makes no step; momentum after +//! the fingers lift makes no step; and a turn ends as egui's scroll turns do (0.15 s without a wheel +//! event, 1 s while a touchpad gesture is under way). + +use super::view::fine_steps; +use super::{Ui, VectorcraftApp, json}; + +/// A wheel turn the Quick Pen tool may take: the motion, in wheel lines, not yet turned into a +/// step; whether the tool took the turn; whether a touchpad gesture is under way (between its Start +/// and End phases); when the turn's last wheel event came (egui's input time); whether a touchpad +/// sent it; and the modifiers the turn holds. +#[derive(Clone, Copy, Default, PartialEq)] +struct ArcWheel { + rest: f32, + taken: bool, + gesture: bool, + last: f64, + trackpad: bool, + held: egui::Modifiers, +} + +/// Seconds without a wheel event after which a wheel event starts a new turn, as egui's own scroll +/// timeouts: 1 s while a touchpad gesture is under way (fingers resting mid-gesture), else 0.15 s. +const TURN_GAP: f64 = 0.150; +const GESTURE_GAP: f64 = 1.0; + +/// Most steps one frame makes: from 1° to 359° is fewer than 24 steps of 15°. +const MOST_STEPS: i32 = 24; + +/// Ctrl alone (the Control key on macOS too). +fn ctrl_alone(m: egui::Modifiers) -> bool { + m.ctrl && !(m.alt || m.shift || m.mac_cmd) +} + +/// With the Quick Pen tool active and the pointer over the canvas (`over`), each wheel event from a +/// mouse wheel turned with Ctrl held makes the arc size one step larger (up) or smaller (down), and a +/// touchpad's motion makes one step per wheel line of it. Momentum after the fingers lift makes no +/// step. Returns true while such a turn goes on, so the view does not zoom or scroll for the rest of +/// it. +pub(super) fn arc_size(app: &mut VectorcraftApp, ui: &Ui, over: bool) -> bool { + let id = egui::Id::unique("quick-pen-arc-wheel"); + let before: ArcWheel = ui.data(|d| d.get_temp(id)).unwrap_or_default(); + let line = ui.ctx().options(|o| o.input_options.line_scroll_speed).max(1.0); + let takes = over && app.session.tool_id() == vectorcraft_tools::quickpen::ID; + let mut now = before; + let (any, scrolling) = ui.input(|i| { + let mut any = false; + for e in &i.events { + let egui::Event::MouseWheel { unit, delta, phase, modifiers, source } = e else { continue }; + any = true; + // A wheel event after egui's scroll timeout, or a touchpad gesture's start, begins a + // new turn: what the turn before it took and left over goes. + let gap = if now.gesture && now.trackpad { GESTURE_GAP } else { TURN_GAP }; + if i.time - now.last > gap || *phase == egui::TouchPhase::Start { + now = ArcWheel::default(); + } + now.last = i.time; + now.trackpad = *source == egui::MouseWheelSource::Trackpad; + // The modifiers held at any point of a touchpad gesture count until it ends, as egui + // keeps them (Ctrl let go still counts, and Shift added stays added); otherwise the + // modifiers of each event count. + match phase { + egui::TouchPhase::Start => { + now.gesture = true; + now.held = *modifiers; + } + egui::TouchPhase::Move if now.gesture => now.held |= *modifiers, + egui::TouchPhase::Move => now.held = *modifiers, + egui::TouchPhase::End | egui::TouchPhase::Cancel => now.gesture = false, + } + if !(takes && ctrl_alone(now.held)) { + continue; + } + now.taken = true; + // Only Move events move, as egui's scroll; momentum after the fingers lift makes no step. + if *phase != egui::TouchPhase::Move || *source == egui::MouseWheelSource::Momentum { + continue; + } + // A mouse wheel's event is one step, whatever it reports (a browser reports a notch in + // points, and a system may scale a fast turn's lines); a touchpad's fine motion steps + // once per wheel line of it. [`fine_steps`] tells them apart, as for the view. Only up + // and down motion counts. + let s = delta.y; + let d = if !fine_steps(*unit, *delta, *source) { + if s == 0.0 { 0.0 } else { s.signum() } + } else if *unit == egui::MouseWheelUnit::Point { + s / line + } else { + s + }; + if d.is_finite() { + now.rest += d; + } + } + (any, i.is_scrolling()) + }); + if !any && !scrolling { + now = ArcWheel::default(); + } + let steps = now.rest.trunc(); + now.rest -= steps; + let (cmd, n) = if steps > 0.0 { ("tool.quickPen.arcLarger", steps) } else { ("tool.quickPen.arcSmaller", -steps) }; + for _ in 0..(n as i32).min(MOST_STEPS) { + match app.run(cmd, json!({})) { + Ok(serde_json::Value::Bool(true)) => {} + Ok(_) => break, + Err(e) => { + app.ui.status = e; + break; + } + } + } + if now != before { + ui.data_mut(|d| d.insert_temp(id, now)); + } + now.taken +} diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 1ffb352a36..fae08e2e60 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -2718,6 +2718,8 @@ font-technology Variable Променливи Continuous Arc Непрекъсната дъга Sharp Corner Arc Дъга с остър ъгъл Flip Arc Обръщане на дъгата + Increase Arc Size Увеличаване на размера на дъгата + Decrease Arc Size Намаляване на размера на дъгата Hide Toolbar Скриване на лентата с инструменти Pin Toolbar Position Закачане на позицията на лентата с инструменти Reset Toolbar Position Нулиране на позицията на лентата с инструменти diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 712106379f..33c34cd2b8 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4223,6 +4223,8 @@ theme Appearance Izgled Continuous Arc Neprekidni luk Sharp Corner Arc Luk s oštrim uglom Flip Arc Preokreni luk + Increase Arc Size Povećaj veličinu luka + Decrease Arc Size Smanji veličinu luka Hide Toolbar Sakrij traku s alatima Pin Toolbar Position Prikvači položaj trake s alatima Reset Toolbar Position Vrati položaj trake s alatima na početno diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 70b7cbf8ee..ecf0120f0d 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3474,6 +3474,8 @@ digits Malayalam Malaiàlam Continuous Arc Arc continu Sharp Corner Arc Arc de cantonada aguda Flip Arc Inverteix l’arc + Increase Arc Size Augmenta la mida de l’arc + Decrease Arc Size Redueix la mida de l’arc Hide Toolbar Amaga la barra d’eines Pin Toolbar Position Fixa la posició de la barra d’eines Reset Toolbar Position Restableix la posició de la barra d’eines diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 9ef6f066e6..384be3cbe3 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4330,6 +4330,8 @@ theme Appearance Motiv Continuous Arc Plynulý oblouk Sharp Corner Arc Oblouk s ostrým rohem Flip Arc Překlopit oblouk + Increase Arc Size Zvětšit velikost oblouku + Decrease Arc Size Zmenšit velikost oblouku Hide Toolbar Skrýt panel nástrojů Pin Toolbar Position Připnout polohu panelu nástrojů Reset Toolbar Position Obnovit polohu panelu nástrojů diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 0d8b14dba4..ed499ef918 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -6787,6 +6787,8 @@ theme Appearance Udseende Continuous Arc Fortløbende bue Sharp Corner Arc Bue med skarpt hjørne Flip Arc Vend bue + Increase Arc Size Øg buestørrelse + Decrease Arc Size Formindsk buestørrelse Hide Toolbar Skjul værktøjslinjen Pin Toolbar Position Fastgør værktøjslinjens placering Reset Toolbar Position Nulstil værktøjslinjens placering diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index bd04b8cc19..f30781515c 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2780,6 +2780,8 @@ file-filter Templates Vorlagen Continuous Arc Fortlaufender Bogen Sharp Corner Arc Bogen mit scharfer Ecke Flip Arc Bogen spiegeln + Increase Arc Size Bogengröße erhöhen + Decrease Arc Size Bogengröße verringern Hide Toolbar Werkzeugleiste ausblenden Pin Toolbar Position Position der Werkzeugleiste fixieren Reset Toolbar Position Position der Werkzeugleiste zurücksetzen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 220e9dede3..229231f0ef 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -2184,6 +2184,8 @@ font-technology Variable Μεταβλητές Continuous Arc Συνεχές τόξο Sharp Corner Arc Τόξο με αιχμηρή γωνία Flip Arc Αναστροφή τόξου + Increase Arc Size Αύξηση μεγέθους τόξου + Decrease Arc Size Μείωση μεγέθους τόξου Hide Toolbar Απόκρυψη γραμμής εργαλείων Pin Toolbar Position Σταθεροποίηση θέσης γραμμής εργαλείων Reset Toolbar Position Επαναφορά θέσης γραμμής εργαλείων diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index 016f297b3b..6da28fcf82 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2821,6 +2821,8 @@ font-technology Variable Variables Continuous Arc Arco continuo Sharp Corner Arc Arco de esquina aguda Flip Arc Voltear arco + Increase Arc Size Aumentar tamaño del arco + Decrease Arc Size Reducir tamaño del arco Hide Toolbar Ocultar barra de herramientas Pin Toolbar Position Fijar posición de la barra de herramientas Reset Toolbar Position Restablecer posición de la barra de herramientas diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index 46b3fbf1d5..6582281378 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4247,6 +4247,8 @@ theme Appearance Ulkoasu Continuous Arc Jatkuva kaari Sharp Corner Arc Terävän kulman kaari Flip Arc Käännä kaari + Increase Arc Size Suurenna kaaren kokoa + Decrease Arc Size Pienennä kaaren kokoa Hide Toolbar Piilota työkalurivi Pin Toolbar Position Kiinnitä työkalurivin sijainti Reset Toolbar Position Palauta työkalurivin sijainti diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 4ce31cfc06..887311455f 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2809,6 +2809,8 @@ font-technology Variable Variables Continuous Arc Arc continu Sharp Corner Arc Arc à angle vif Flip Arc Retourner l’arc + Increase Arc Size Augmenter la taille de l’arc + Decrease Arc Size Réduire la taille de l’arc Hide Toolbar Masquer la barre d’outils Pin Toolbar Position Épingler la position de la barre d’outils Reset Toolbar Position Réinitialiser la position de la barre d’outils diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index f1ad753245..733f7f5e04 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -2827,6 +2827,8 @@ Continuous Arc સતત આર્ક Sharp Corner Arc તીક્ષ્ણ ખૂણાવાળો આર્ક Flip Arc આર્ક ફ્લિપ કરો + Increase Arc Size આર્કનું કદ વધારો + Decrease Arc Size આર્કનું કદ ઘટાડો Hide Toolbar ટૂલબાર છુપાવો Pin Toolbar Position ટૂલબાર સ્થિતિ પિન કરો Reset Toolbar Position ટૂલબાર સ્થિતિ રીસેટ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index c8852f1ddd..d8b632fefd 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4021,6 +4021,8 @@ arrowhead Feather पंख Continuous Arc सतत आर्क Sharp Corner Arc तीखे कोने वाला आर्क Flip Arc आर्क पलटें + Increase Arc Size आर्क का आकार बढ़ाएँ + Decrease Arc Size आर्क का आकार घटाएँ Hide Toolbar टूलबार छिपाएँ Pin Toolbar Position टूलबार स्थिति पिन करें Reset Toolbar Position टूलबार स्थिति रीसेट करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index 54ff192eed..08a100ae60 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3350,6 +3350,8 @@ file-filter Templates Sablonok Continuous Arc Folytonos ív Sharp Corner Arc Éles sarkú ív Flip Arc Ív tükrözése + Increase Arc Size Ívméret növelése + Decrease Arc Size Ívméret csökkentése Hide Toolbar Eszköztár elrejtése Pin Toolbar Position Eszköztár helyének rögzítése Reset Toolbar Position Eszköztár helyének visszaállítása diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index 9a0f622d21..2c4d277610 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4655,6 +4655,8 @@ theme Appearance Tampilan Continuous Arc Busur bersambung Sharp Corner Arc Busur sudut tajam Flip Arc Balik busur + Increase Arc Size Perbesar ukuran busur + Decrease Arc Size Perkecil ukuran busur Hide Toolbar Sembunyikan bilah alat Pin Toolbar Position Sematkan posisi bilah alat Reset Toolbar Position Atur ulang posisi bilah alat diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 190b136a06..50db260c8a 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2865,6 +2865,8 @@ file-filter Templates Modelli Continuous Arc Arco continuo Sharp Corner Arc Arco ad angolo vivo Flip Arc Capovolgi arco + Increase Arc Size Aumenta dimensione arco + Decrease Arc Size Riduci dimensione arco Hide Toolbar Nascondi barra degli strumenti Pin Toolbar Position Fissa posizione barra degli strumenti Reset Toolbar Position Ripristina posizione barra degli strumenti diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 665e74c319..847716df08 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -2955,6 +2955,8 @@ antiAlias Sharp シャープ Continuous Arc 連続円弧 Sharp Corner Arc 鋭角円弧 Flip Arc 円弧を反転 + Increase Arc Size 円弧のサイズを大きく + Decrease Arc Size 円弧のサイズを小さく Hide Toolbar ツールバーを隠す Pin Toolbar Position ツールバーの位置を固定 Reset Toolbar Position ツールバーの位置をリセット diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index d3ea2160c1..6472689e0f 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6068,6 +6068,8 @@ theme Appearance იერსახე Continuous Arc უწყვეტი რკალი Sharp Corner Arc მახვილკუთხიანი რკალი Flip Arc რკალის არეკვლა + Increase Arc Size რკალის ზომის გაზრდა + Decrease Arc Size რკალის ზომის შემცირება Hide Toolbar ხელსაწყოთა ზოლის დამალვა Pin Toolbar Position ხელსაწყოთა ზოლის პოზიციის ჩამაგრება Reset Toolbar Position ხელსაწყოთა ზოლის პოზიციის ჩამოყრა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 0c2642f758..26fc1eeacd 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -2945,6 +2945,8 @@ antiAlias Sharp 날카롭게 Continuous Arc 연속 호 Sharp Corner Arc 뾰족한 모서리 호 Flip Arc 호 뒤집기 + Increase Arc Size 호 크기 늘리기 + Decrease Arc Size 호 크기 줄이기 Hide Toolbar 도구 모음 숨기기 Pin Toolbar Position 도구 모음 위치 고정 Reset Toolbar Position 도구 모음 위치 재설정 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index c1f7e36426..670b00a5aa 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4655,6 +4655,8 @@ theme Appearance Vormgeving Continuous Arc Doorlopende boog Sharp Corner Arc Boog met scherpe hoek Flip Arc Boog spiegelen + Increase Arc Size Boog groter maken + Decrease Arc Size Boog kleiner maken Hide Toolbar Werkbalk verbergen Pin Toolbar Position Werkbalkpositie vastzetten Reset Toolbar Position Werkbalkpositie herstellen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index 5808ddb8c2..5478f6dd28 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4195,6 +4195,8 @@ theme Appearance Wygląd Continuous Arc Łuk ciągły Sharp Corner Arc Łuk z ostrym narożnikiem Flip Arc Odwróć łuk + Increase Arc Size Zwiększ rozmiar łuku + Decrease Arc Size Zmniejsz rozmiar łuku Hide Toolbar Ukryj pasek narzędzi Pin Toolbar Position Przypnij położenie paska narzędzi Reset Toolbar Position Resetuj położenie paska narzędzi diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 2204a2bdc1..12749b8c83 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2323,6 +2323,8 @@ antiAlias Sharp Nítido Continuous Arc Arco Contínuo Sharp Corner Arc Arco de Canto Agudo Flip Arc Virar Arco + Increase Arc Size Aumentar Tamanho do Arco + Decrease Arc Size Diminuir Tamanho do Arco Hide Toolbar Ocultar Barra de Ferramentas Pin Toolbar Position Fixar Posição da Barra de Ferramentas Reset Toolbar Position Redefinir Posição da Barra de Ferramentas diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index b3ca5d5d93..2b40f73140 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2847,6 +2847,8 @@ file-filter Templates Шаблоны Continuous Arc Непрерывная дуга Sharp Corner Arc Дуга с острым углом Flip Arc Отразить дугу + Increase Arc Size Увеличить размер дуги + Decrease Arc Size Уменьшить размер дуги Hide Toolbar Скрыть панель инструментов Pin Toolbar Position Закрепить положение панели инструментов Reset Toolbar Position Сбросить положение панели инструментов diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 94a83ef975..f2b71da213 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -2742,6 +2742,8 @@ font-technology Variable Variabla Continuous Arc Kontinuerlig båge Sharp Corner Arc Båge med skarpt hörn Flip Arc Vänd båge + Increase Arc Size Öka bågstorlek + Decrease Arc Size Minska bågstorlek Hide Toolbar Dölj verktygsfältet Pin Toolbar Position Fäst verktygsfältets position Reset Toolbar Position Återställ verktygsfältets position diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index 2fcd6d3b54..4ed628133b 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2591,6 +2591,8 @@ shape Open Açık Continuous Arc Sürekli Yay Sharp Corner Arc Keskin Köşeli Yay Flip Arc Yayı Çevir + Increase Arc Size Yay Boyutunu Artır + Decrease Arc Size Yay Boyutunu Azalt Hide Toolbar Araç Çubuğunu Gizle Pin Toolbar Position Araç Çubuğu Konumunu Sabitle Reset Toolbar Position Araç Çubuğu Konumunu Sıfırla diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index 49f8383268..31fdb3c4dc 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -2857,6 +2857,8 @@ file-filter Templates Шаблони Continuous Arc Неперервна дуга Sharp Corner Arc Дуга з гострим кутом Flip Arc Відобразити дугу + Increase Arc Size Збільшити розмір дуги + Decrease Arc Size Зменшити розмір дуги Hide Toolbar Сховати панель інструментів Pin Toolbar Position Закріпити положення панелі інструментів Reset Toolbar Position Скинути положення панелі інструментів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index 13d02e5184..d900872d1a 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3170,6 +3170,8 @@ digits Hindi Hindi Continuous Arc Cung liên tục Sharp Corner Arc Cung góc nhọn Flip Arc Lật cung + Increase Arc Size Tăng kích thước cung + Decrease Arc Size Giảm kích thước cung Hide Toolbar Ẩn thanh công cụ Pin Toolbar Position Ghim vị trí thanh công cụ Reset Toolbar Position Đặt lại vị trí thanh công cụ diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index f51baaa7e7..43eae51e7c 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2708,6 +2708,8 @@ file-filter Templates 模板 Continuous Arc 连续弧线 Sharp Corner Arc 尖角弧线 Flip Arc 翻转弧线 + Increase Arc Size 增大弧线尺寸 + Decrease Arc Size 减小弧线尺寸 Hide Toolbar 隐藏工具栏 Pin Toolbar Position 固定工具栏位置 Reset Toolbar Position 重置工具栏位置 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index d794ea15d9..5f585aa79e 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4151,6 +4151,8 @@ liquify-list-end {0}, {1} {0}和{1} Continuous Arc 連續弧線 Sharp Corner Arc 尖角弧線 Flip Arc 翻轉弧線 + Increase Arc Size 增大弧線尺寸 + Decrease Arc Size 減小弧線尺寸 Hide Toolbar 隱藏工具列 Pin Toolbar Position 釘選工具列位置 Reset Toolbar Position 重設工具列位置 diff --git a/crates/ui-egui/src/menus/run.rs b/crates/ui-egui/src/menus/run.rs index 8c2767e20b..1aabf9faf4 100644 --- a/crates/ui-egui/src/menus/run.rs +++ b/crates/ui-egui/src/menus/run.rs @@ -725,6 +725,39 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option Err(e.to_string()), } } + "tool.quickPen.arcLarger" | "tool.quickPen.arcSmaller" => { + // `]` or `[`, for Ctrl+wheel over the canvas: the arc size 15° larger or smaller. Input + // held for an edit is finished first, as for Flip Arc. False, with nothing changed beyond + // that, while the Quick Pen tool is not active or the step would leave 1° to 359°. + match app.session.finish_tool_edit() { + Ok(reqs) => crate::canvas::apply_requests(app, Ok(reqs)), + Err(e) => return Some(Err(e.to_string())), + } + if app.session.tool_id() != vectorcraft_tools::quickpen::ID { + return Some(Ok(json!(false))); + } + let key = + if id == "tool.quickPen.arcLarger" { vectorcraft_tools::ToolKey::BracketRight } else { vectorcraft_tools::ToolKey::BracketLeft }; + // A step changes the tool's size, or draws the arc again: as an edit between presses, or + // as the preview of a drag (applied, or kept for the release with Real-time Drawing off). + let state = |app: &VectorcraftApp| { + let d = app.session.active(); + ( + app.session.tool_options()["turn"].clone(), + d.map(|d| d.revision), + d.and_then(|d| d.interaction.as_ref()).and_then(|it| it.preview.clone()), + ) + }; + let before = state(app); + let view = app.view_info(); + match app.session.tool_key(key, vectorcraft_tools::Mods::default(), view) { + Ok(reqs) => { + crate::canvas::apply_requests(app, Ok(reqs)); + Ok(json!(state(app) != before)) + } + Err(e) => Err(e.to_string()), + } + } "window.dock" => { let ui = &mut app.ui; // The bars the last Tab hid show again, unless the toolbar or the Control bar was shown diff --git a/crates/ui-egui/src/menus/ui_commands.rs b/crates/ui-egui/src/menus/ui_commands.rs index ad562ecd6c..ccb4281794 100644 --- a/crates/ui-egui/src/menus/ui_commands.rs +++ b/crates/ui-egui/src/menus/ui_commands.rs @@ -719,6 +719,18 @@ pub const UI_COMMANDS: &[(&str, &str, &str, &str)] = &[ "", "{} flip the last sharp-corner arc of the path the Quick Pen tool is drawing to the other side of its chord, as C and the toolbar's Flip Arc button do, as one undo step; first finishes any pending tool edit (which can change the document), then returns false, changing nothing more, when the Quick Pen tool is not active, no path is being drawn or the last piece is not a sharp-corner arc", ), + ( + "tool.quickPen.arcLarger", + "Increase Arc Size", + "", + "{} make the Quick Pen tool's arc size 15° larger, for the last sharp-corner arc of the path being drawn and the arcs after it, as ] and Ctrl+wheel up over the canvas do; first finishes any pending tool edit (which can change the document), then returns false, changing nothing more, when the Quick Pen tool is not active or a step would take the arc size above 359°", + ), + ( + "tool.quickPen.arcSmaller", + "Decrease Arc Size", + "", + "{} make the Quick Pen tool's arc size 15° smaller, for the last sharp-corner arc of the path being drawn and the arcs after it, as [ and Ctrl+wheel down over the canvas do; first finishes any pending tool edit (which can change the document), then returns false, changing nothing more, when the Quick Pen tool is not active or a step would take the arc size below 1°", + ), ( "window.dock", "Panels", diff --git a/crates/ui-egui/src/palette.rs b/crates/ui-egui/src/palette.rs index a3c5fed207..3f6883781c 100644 --- a/crates/ui-egui/src/palette.rs +++ b/crates/ui-egui/src/palette.rs @@ -5474,7 +5474,7 @@ mod tests { let mut window = Window::new(); window.app.ui.toolbar = false; window.app.ui.custom_toolbars.push(drawing_toolbar([100.0, 120.0])); - window.search("pen tool"); + window.search("pen tools"); let small = window.popup(); window.app.ui.custom_toolbars[0].pos = [small.center().x, small.bottom() + 2.0]; window.frame(vec![]); diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index e0619ddaf7..705ff99794 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -31,6 +31,7 @@ mod printps; mod printtiling; mod puppetwarp; mod quickpenbar; +mod quickpenwheel; mod recolor; mod recovery; pub(super) mod removeanchors; diff --git a/crates/ui-egui/src/tests/quickpenwheel.rs b/crates/ui-egui/src/tests/quickpenwheel.rs new file mode 100644 index 0000000000..597035bc47 --- /dev/null +++ b/crates/ui-egui/src/tests/quickpenwheel.rs @@ -0,0 +1,407 @@ +//! Ctrl+wheel over the canvas with the Quick Pen tool changes the arc size and leaves the view as it +//! is; the arc size commands step it as `[` and `]` do. + +use egui::{Event, Modifiers, MouseWheelSource, MouseWheelUnit, Pos2, Rect, vec2}; +use serde_json::json; +use vectorcraft_doc::NodeKind; +use vectorcraft_geom::SubPath; +use vectorcraft_tools::{PointerEvent, PointerKind}; + +use crate::{VectorcraftApp, canvas}; + +fn app() -> VectorcraftApp { + let mut app = VectorcraftApp::new(vectorcraft_engine::Session::new(), Default::default()); + app.run("file.new", json!({"width": 400, "height": 300})).unwrap(); + app.select_tool("quickPen"); + app.run("tool.setOption", json!({"key": "action", "value": "sharpArc"})).unwrap(); + app +} + +fn frame(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec) { + frame_at(app, ctx, events, None); +} + +/// [`frame`] at input `time` (seconds), when given. +fn frame_at(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec, time: Option) { + let screen = Rect::from_min_size(Pos2::ZERO, vec2(1000.0, 700.0)); + let mut out = ctx.run_ui(egui::RawInput { screen_rect: Some(screen), events, time, ..Default::default() }, |ui| canvas::show(app, ui)); + out.textures_delta.clear(); +} + +/// A wheel turn over the middle of the canvas, then frames enough for egui to let out all of it. +fn turn(app: &mut VectorcraftApp, ctx: &egui::Context, unit: MouseWheelUnit, dy: f32, modifiers: Modifiers, source: MouseWheelSource) { + let at = app.canvas_rect.unwrap().center(); + let wheel = Event::MouseWheel { unit, delta: vec2(0.0, dy), phase: egui::TouchPhase::Move, modifiers, source }; + frame(app, ctx, vec![Event::PointerMoved(at), wheel]); + for _ in 0..40 { + frame(app, ctx, vec![]); + } +} + +fn click_doc(app: &mut VectorcraftApp, x: f64, y: f64) { + let v = app.view_info(); + for kind in [PointerKind::Down, PointerKind::Up] { + app.session.pointer(&PointerEvent::new(kind, x, y), v).unwrap(); + } +} + +fn paths(app: &VectorcraftApp) -> Vec { + let mut v = vec![]; + app.session.active().unwrap().doc.walk(|n| { + if let NodeKind::Path { path, .. } = &n.kind { + v.extend(path.subpaths.iter().cloned()); + } + }); + v +} + +fn arc_size(app: &VectorcraftApp) -> f64 { + app.session.tool_options()["turn"].as_f64().unwrap() +} + +/// (zoom, center x, center y) of the view. +fn view(app: &VectorcraftApp) -> (f64, f64, f64) { + let v = app.view().unwrap(); + (v.zoom, v.center.x, v.center.y) +} + +/// Ctrl+wheel with the Quick Pen tool: a notch up makes the last sharp-corner arc 15° larger and a +/// notch down 15° smaller, each as one undo step, with Ctrl as Windows and Linux report it (with +/// Command) and as macOS reports the Control key (alone). A touchpad steps once per wheel line of +/// motion. The view neither zooms nor scrolls. +#[test] +fn ctrl_wheel_changes_the_arc_size_and_not_the_view() { + let mut app = app(); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + frame(&mut app, &ctx, vec![]); + click_doc(&mut app, 100.0, 150.0); + click_doc(&mut app, 200.0, 150.0); + let drawn = paths(&app)[0].clone(); + let undo = app.session.active().unwrap().history.undo.len(); + let still = view(&app); + let ctrl = Modifiers { ctrl: true, command: true, ..Modifiers::NONE }; + let line = ctx.options(|o| o.input_options.line_scroll_speed); + + turn(&mut app, &ctx, MouseWheelUnit::Line, 1.0, ctrl, MouseWheelSource::Wheel); + assert_eq!(arc_size(&app), 195.0); + assert_ne!(paths(&app)[0], drawn, "the last arc changed"); + assert_eq!(paths(&app).len(), 1); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo + 1); + assert_eq!(view(&app), still, "Ctrl+wheel did not zoom or scroll"); + + let at = app.canvas_rect.unwrap().center(); + let notch = |dy: f32, modifiers| Event::MouseWheel { + unit: MouseWheelUnit::Line, + delta: vec2(0.0, dy), + phase: egui::TouchPhase::Move, + modifiers, + source: MouseWheelSource::Wheel, + }; + frame(&mut app, &ctx, vec![Event::PointerMoved(at), notch(-1.0, Modifiers::CTRL), notch(-1.0, Modifiers::CTRL)]); + for _ in 0..40 { + frame(&mut app, &ctx, vec![]); + } + assert_eq!(arc_size(&app), 165.0, "two notches down with the macOS Control key"); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo + 3); + assert_eq!(view(&app), still); + + // A mouse wheel's event is one step, whether the system scaled a fast turn's lines or reports a + // fraction of a line. + turn(&mut app, &ctx, MouseWheelUnit::Line, 4.5, ctrl, MouseWheelSource::Wheel); + assert_eq!(arc_size(&app), 180.0, "a fast notch of four and a half lines"); + turn(&mut app, &ctx, MouseWheelUnit::Line, -0.3, ctrl, MouseWheelSource::Wheel); + assert_eq!(arc_size(&app), 165.0, "a notch of three tenths of a line"); + // With Shift, Alt or Command added (Cmd on macOS), the wheel leaves the arc size. + for modifiers in [ + Modifiers { shift: true, ..ctrl }, + Modifiers { alt: true, ..ctrl }, + Modifiers { mac_cmd: true, command: true, ..Modifiers::NONE }, + Modifiers { mac_cmd: true, ..Modifiers::CTRL }, + ] { + turn(&mut app, &ctx, MouseWheelUnit::Line, 1.0, modifiers, MouseWheelSource::Wheel); + assert_eq!(arc_size(&app), 165.0, "{modifiers:?}"); + } + turn(&mut app, &ctx, MouseWheelUnit::Line, 1.0, ctrl, MouseWheelSource::Wheel); + assert_eq!(arc_size(&app), 180.0); + // Sideways motion leaves the arc size. + let sideways = Event::MouseWheel { + unit: MouseWheelUnit::Line, + delta: vec2(1.0, 0.0), + phase: egui::TouchPhase::Move, + modifiers: ctrl, + source: MouseWheelSource::Wheel, + }; + frame(&mut app, &ctx, vec![Event::PointerMoved(at), sideways]); + for _ in 0..40 { + frame(&mut app, &ctx, vec![]); + } + assert_eq!(arc_size(&app), 180.0, "sideways"); + let still = view(&app); + + // Half a wheel line from a touchpad makes no step; the second half of the same turn makes one, + // and momentum after it makes none. + let steps = app.session.active().unwrap().history.undo.len(); + let at = app.canvas_rect.unwrap().center(); + let fine = |dy: f32, source| Event::MouseWheel { + unit: MouseWheelUnit::Point, + delta: vec2(0.0, dy), + phase: egui::TouchPhase::Move, + modifiers: ctrl, + source, + }; + frame(&mut app, &ctx, vec![Event::PointerMoved(at), fine(line / 2.0, MouseWheelSource::Trackpad)]); + assert_eq!(arc_size(&app), 180.0); + frame(&mut app, &ctx, vec![fine(line / 2.0, MouseWheelSource::Trackpad)]); + assert_eq!(arc_size(&app), 195.0); + frame(&mut app, &ctx, vec![fine(3.0 * line, MouseWheelSource::Momentum)]); + assert_eq!(arc_size(&app), 195.0, "momentum makes no step"); + for _ in 0..40 { + frame(&mut app, &ctx, vec![]); + } + assert_eq!(view(&app), still); + assert_eq!(app.session.active().unwrap().history.undo.len(), steps + 1, "one step and no piece"); + + // Without Ctrl the wheel scrolls the view and leaves the arc size. + turn(&mut app, &ctx, MouseWheelUnit::Line, 1.0, Modifiers::NONE, MouseWheelSource::Wheel); + assert_eq!(arc_size(&app), 195.0); + assert_ne!(view(&app), still, "the wheel scrolled"); +} + +/// Ctrl+wheel while a press drags a sharp-corner arc: the arc being dragged takes the new size, the +/// drag goes on, and once the press is let go the piece and its size change are one undo step. +#[test] +fn ctrl_wheel_sizes_the_arc_being_dragged() { + let mut app = app(); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + frame(&mut app, &ctx, vec![]); + click_doc(&mut app, 100.0, 150.0); + let undo = app.session.active().unwrap().history.undo.len(); + let c = app.canvas_rect.unwrap().center(); + let from = c + vec2(150.0, 80.0); + let button = |pos, pressed| Event::PointerButton { pos, button: egui::PointerButton::Primary, pressed, modifiers: Modifiers::NONE }; + frame(&mut app, &ctx, vec![Event::PointerMoved(from), button(from, true)]); + let mut to = from; + for _ in 0..5 { + to += vec2(14.0, 0.0); + frame(&mut app, &ctx, vec![Event::PointerMoved(to)]); + } + assert!(app.session.tool_busy(), "the press drags"); + let dragged = paths(&app)[0].clone(); + let ctrl = Modifiers { ctrl: true, command: true, ..Modifiers::NONE }; + let notch = Event::MouseWheel { + unit: MouseWheelUnit::Line, + delta: vec2(0.0, 1.0), + phase: egui::TouchPhase::Move, + modifiers: ctrl, + source: MouseWheelSource::Wheel, + }; + frame(&mut app, &ctx, vec![notch]); + assert_eq!(arc_size(&app), 195.0); + assert!(app.session.tool_busy(), "the drag goes on"); + assert_eq!(paths(&app).len(), 1); + assert_ne!(paths(&app)[0], dragged, "the arc being dragged is drawn again with the new size"); + // The tool's size set ahead of the dragged arc's: a step that brings the arc to it still reports + // the change. + app.run("tool.setOption", json!({"key": "turn", "value": 210})).unwrap(); + let sized = paths(&app)[0].clone(); + assert_eq!(app.run("tool.quickPen.arcLarger", json!({})).unwrap(), json!(true)); + assert_eq!(arc_size(&app), 210.0); + assert_ne!(paths(&app)[0], sized); + assert!(app.session.tool_busy()); + frame(&mut app, &ctx, vec![button(to, false)]); + for _ in 0..3 { + frame(&mut app, &ctx, vec![]); + } + assert!(!app.session.tool_busy()); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo + 1, "the piece and its size change are one undo step"); +} + +/// Ctrl+wheel over the Quick Pen toolbar, which floats over the canvas, leaves the arc size; half a +/// wheel line from a touchpad does not add to half a line from a later turn. +#[test] +fn ctrl_wheel_over_the_toolbar_or_in_two_turns_makes_no_step() { + let mut app = app(); + let ctx = egui::Context::default(); + for _ in 0..3 { + frame(&mut app, &ctx, vec![]); + } + let ctrl = Modifiers { ctrl: true, command: true, ..Modifiers::NONE }; + let bar = canvas::quick_pen_bar_rect(&ctx).expect("the toolbar shows"); + let notch = |modifiers| Event::MouseWheel { + unit: MouseWheelUnit::Line, + delta: vec2(0.0, 1.0), + phase: egui::TouchPhase::Move, + modifiers, + source: MouseWheelSource::Wheel, + }; + frame(&mut app, &ctx, vec![Event::PointerMoved(bar.center()), notch(ctrl)]); + for _ in 0..40 { + frame(&mut app, &ctx, vec![]); + } + assert_eq!(arc_size(&app), 180.0, "over the toolbar"); + + let line = ctx.options(|o| o.input_options.line_scroll_speed); + let at = app.canvas_rect.unwrap().center(); + let half = Event::MouseWheel { + unit: MouseWheelUnit::Point, + delta: vec2(0.0, line / 2.0), + phase: egui::TouchPhase::Move, + modifiers: ctrl, + source: MouseWheelSource::Trackpad, + }; + // Two halves a second apart, with no frame in between. + frame_at(&mut app, &ctx, vec![Event::PointerMoved(at), half.clone()], Some(100.0)); + frame_at(&mut app, &ctx, vec![half.clone()], Some(101.0)); + assert_eq!(arc_size(&app), 180.0, "two turns of half a line each"); + + // Within one touchpad gesture, a pause of half a second keeps the half line from before it. + let phased = |phase| match half.clone() { + Event::MouseWheel { unit, delta, modifiers, source, .. } => Event::MouseWheel { unit, delta, phase, modifiers, source }, + e => e, + }; + // The Start event's motion does not count, as for egui's scroll. + frame_at(&mut app, &ctx, vec![phased(egui::TouchPhase::Start), phased(egui::TouchPhase::Move)], Some(200.0)); + assert_eq!(arc_size(&app), 180.0, "a half line and the motion of a Start"); + // Ctrl let go during the gesture still counts until it ends. + let let_go = match phased(egui::TouchPhase::Move) { + Event::MouseWheel { unit, delta, phase, source, .. } => Event::MouseWheel { unit, delta, phase, modifiers: Modifiers::NONE, source }, + e => e, + }; + frame_at(&mut app, &ctx, vec![let_go], Some(200.5)); + assert_eq!(arc_size(&app), 195.0, "one gesture of two half lines"); + // Shift joining the gesture ends what Ctrl held. + let shifted = match phased(egui::TouchPhase::Move) { + Event::MouseWheel { unit, delta, phase, source, .. } => Event::MouseWheel { unit, delta, phase, modifiers: Modifiers::SHIFT, source }, + e => e, + }; + frame_at(&mut app, &ctx, vec![shifted.clone(), shifted], Some(200.6)); + assert_eq!(arc_size(&app), 195.0, "Shift joined the gesture"); + frame_at(&mut app, &ctx, vec![phased(egui::TouchPhase::Move), phased(egui::TouchPhase::Move)], Some(200.7)); + assert_eq!(arc_size(&app), 195.0, "Shift let go stays in the gesture"); + + // A plain wheel turn half a second after the Ctrl one, with no frame in between, scrolls. + let still = view(&app); + let plain = Event::MouseWheel { + unit: MouseWheelUnit::Line, + delta: vec2(0.0, 1.0), + phase: egui::TouchPhase::Move, + modifiers: Modifiers::NONE, + source: MouseWheelSource::Wheel, + }; + frame_at(&mut app, &ctx, vec![phased(egui::TouchPhase::End)], Some(201.0)); + frame_at(&mut app, &ctx, vec![plain], Some(201.5)); + for k in 1..=40 { + frame_at(&mut app, &ctx, vec![], Some(201.5 + f64::from(k) / 60.0)); + } + assert_eq!(arc_size(&app), 195.0); + assert_ne!(view(&app), still, "the plain turn scrolled"); + + // From a source that is not named a touchpad, the same pause within a gesture ends the turn, + // as egui's scroll timeout does. + let unknown = |phase| match phased(phase) { + Event::MouseWheel { unit, delta, phase, modifiers, .. } => { + Event::MouseWheel { unit, delta, phase, modifiers, source: MouseWheelSource::Unknown } + } + e => e, + }; + frame_at(&mut app, &ctx, vec![Event::PointerMoved(at), unknown(egui::TouchPhase::Start), unknown(egui::TouchPhase::Move)], Some(300.0)); + frame_at(&mut app, &ctx, vec![unknown(egui::TouchPhase::Move)], Some(300.5)); + assert_eq!(arc_size(&app), 195.0, "two turns of half a line each from an unnamed source"); +} + +/// A mouse wheel that reports its notches in points (as a browser does) steps once per notch, +/// however many points a notch is. Under a modal dialog, and for the rest of a turn begun under it, +/// Ctrl+wheel leaves the arc size. +#[test] +fn ctrl_wheel_steps_per_notch_and_not_under_a_dialog() { + let mut app = app(); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + frame(&mut app, &ctx, vec![]); + let ctrl = Modifiers { ctrl: true, command: true, ..Modifiers::NONE }; + turn(&mut app, &ctx, MouseWheelUnit::Point, 100.0, ctrl, MouseWheelSource::Wheel); + assert_eq!(arc_size(&app), 195.0, "one notch of 100 points"); + turn(&mut app, &ctx, MouseWheelUnit::Point, -3.0, ctrl, MouseWheelSource::Wheel); + assert_eq!(arc_size(&app), 180.0, "one notch of 3 points"); + // On the desktop, point motion from an unknown source is a touchpad's: it steps once per wheel + // line, and smaller motion adds up within the turn. + let line = ctx.options(|o| o.input_options.line_scroll_speed); + turn(&mut app, &ctx, MouseWheelUnit::Point, 2.5 * line, ctrl, MouseWheelSource::Unknown); + assert_eq!(arc_size(&app), 210.0, "two and a half lines"); + turn(&mut app, &ctx, MouseWheelUnit::Point, -line, ctrl, MouseWheelSource::Unknown); + assert_eq!(arc_size(&app), 195.0, "the half line left over did not count in a later turn"); + let small = Event::MouseWheel { + unit: MouseWheelUnit::Point, + delta: vec2(0.0, -line / 4.0), + phase: egui::TouchPhase::Move, + modifiers: ctrl, + source: MouseWheelSource::Unknown, + }; + let at = app.canvas_rect.unwrap().center(); + frame(&mut app, &ctx, vec![Event::PointerMoved(at), small.clone(), small.clone(), small.clone()]); + assert_eq!(arc_size(&app), 195.0, "three quarters of a line"); + frame(&mut app, &ctx, vec![small]); + assert_eq!(arc_size(&app), 180.0, "a whole line"); + for _ in 0..40 { + frame(&mut app, &ctx, vec![]); + } + + let notch = Event::MouseWheel { + unit: MouseWheelUnit::Line, + delta: vec2(0.0, 1.0), + phase: egui::TouchPhase::Move, + modifiers: ctrl, + source: MouseWheelSource::Wheel, + }; + app.ui.dialog = Some(crate::state::Dialog::new("preferences", json!({}))); + frame_at(&mut app, &ctx, vec![Event::PointerMoved(at), notch.clone()], Some(300.0)); + assert_eq!(arc_size(&app), 180.0, "under the dialog"); + app.ui.dialog = None; + frame_at(&mut app, &ctx, vec![notch], Some(300.05)); + assert_eq!(arc_size(&app), 180.0, "the rest of a turn begun under the dialog"); +} + +/// With another tool, Ctrl+wheel leaves the Quick Pen's arc size and moves the view as before. +#[test] +fn ctrl_wheel_with_another_tool_moves_the_view() { + let mut app = app(); + app.select_tool("pen"); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + frame(&mut app, &ctx, vec![]); + let still = view(&app); + turn(&mut app, &ctx, MouseWheelUnit::Line, 1.0, Modifiers { ctrl: true, command: true, ..Modifiers::NONE }, MouseWheelSource::Wheel); + assert_eq!(app.session.tool_options_of("quickPen")["turn"], json!(180.0)); + assert_ne!(view(&app), still); +} + +/// The arc size commands step the size by 15° within 1° to 359°, return false at the ends and with +/// another tool, and change the last sharp-corner arc of the path being drawn. +#[test] +fn the_arc_size_commands_step_within_the_range() { + let mut app = app(); + assert_eq!(app.run("tool.quickPen.arcLarger", json!({})).unwrap(), json!(true)); + assert_eq!(arc_size(&app), 195.0); + assert_eq!(app.run("tool.quickPen.arcSmaller", json!({})).unwrap(), json!(true)); + for _ in 0..10 { + assert_eq!(app.run("tool.quickPen.arcLarger", json!({})).unwrap(), json!(true)); + } + assert_eq!(arc_size(&app), 330.0); + assert_eq!(app.run("tool.quickPen.arcLarger", json!({})).unwrap(), json!(true)); + assert_eq!(app.run("tool.quickPen.arcLarger", json!({})).unwrap(), json!(false), "360° is past 359°"); + assert_eq!(arc_size(&app), 345.0); + + click_doc(&mut app, 100.0, 150.0); + click_doc(&mut app, 200.0, 150.0); + let drawn = paths(&app)[0].clone(); + let undo = app.session.active().unwrap().history.undo.len(); + assert_eq!(app.run("tool.quickPen.arcSmaller", json!({})).unwrap(), json!(true)); + assert_ne!(paths(&app)[0], drawn); + assert_eq!(app.session.active().unwrap().history.undo.len(), undo + 1); + + app.select_tool("pen"); + assert_eq!(app.run("tool.quickPen.arcSmaller", json!({})).unwrap(), json!(false)); + assert_eq!(app.session.tool_options_of("quickPen")["turn"], json!(330.0)); +} diff --git a/docs/mcp.md b/docs/mcp.md index ae119cc4b1..850fc50cd1 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -7303,16 +7303,25 @@ path's last point, drawn with the tool's `action` option: Alt (Option on macOS) pressed and let go with no other key, click or wheel turn in between switches to the next action: Line, Continuous Arc, Sharp Corner Arc, and back to Line. C flips the last piece, while it is a sharp-corner arc, to the other side of its chord. `[` and `]` make the arc size 15° smaller or larger, for the last sharp-corner arc and the -arcs after it. During a drag, C and `[` `]` change the sharp-corner arc being dragged, and Alt switches its action. A -dragged piece ends where the press is let go. A click on the first point closes the path, and a click on an end of an -open path goes on drawing from that end. Escape or Enter ends the path, and so does an edit made to it by another -command. An edit made by another command during a drag, to the path or to other art, also ends the path: the edit +arcs after it, as `tool.quickPen.arcSmaller {}` and `tool.quickPen.arcLarger {}` do (each first finishes any pending +tool edit, then returns false, changing nothing more, when the Quick Pen tool is not active or the step would leave 1° to +359°). `tool.quickPen.arcSmaller` and `tool.quickPen.arcLarger` run in the desktop app (`--connect`). Ctrl with a +scroll on a touchpad over the canvas (the Control key on macOS too) changes the arc size as well, as +[Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html) +lists: the touchpad makes one step for each wheel line of its motion, and motion that goes on after the fingers lift +makes none. A mouse wheel turned with Ctrl over the canvas does the same, one step for each wheel event (one per +notch). Up makes the arc size larger and down smaller, sideways motion makes no step, and the view does not zoom or +scroll for the rest of that wheel turn. During a drag, C, `[` `]` and the wheel change the sharp-corner arc being +dragged, and Alt switches its action. A dragged piece ends where the press is let go. A click on the first point +closes the path, and a click on an end of an open path goes on drawing from that end. Escape or Enter ends the path, +and so does an edit made to it by another command. An edit made by another command during a drag, to the path or to other art, also ends the path: the edit stays, and the piece stays as last shown. With the `realTimeDrawing` preference off, a press during which another command edits the document adds no piece, and the edit stays. The path's points show as circles without handles, and a preview shows the piece the next click adds. Points snap to Smart Guides. Each piece is one undo step, together with the flips and size changes made during its drag, and each flip or size change made between presses is one undo step. The -arc size of 180°, its 15° steps, the side an arc bulges to, what C and `[` `]` do during a drag and Enter ending the -path are VectorCraft's own rules. The tool keeps `action` and `turn` with the preferences +arc size of 180°, its 15° steps, the side an arc bulges to, what C, `[` `]` and the wheel do during a drag, Enter +ending the path, the mouse wheel changing the arc size, and the wheel's step per event or wheel line and its direction are +VectorCraft's own rules. The tool keeps `action` and `turn` with the preferences (`tool.setOption {tool: "quickPen", key, value}`). Selecting the tool shows its toolbar on the canvas: Straight Line, Continuous Arc and Sharp Corner Arc set `action`, diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index 0616b700f0..9734e21c74 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -633,7 +633,7 @@ since 2026-10-01. - **Trim View hides guides and the grid (#8363):** while View › Trim View is on, the canvas and tiled panes draw no ruler guides, no guide paths and no grid, the guides are neither snapped to nor picked, and Show/Hide Guides and Show/Hide Grid are greyed out (menu bar, canvas context menu, Properties) and refuse to run; the stored choices come back when it is turned off, and the rulers stay ([trim view hides guides](https://community.adobe.com/t5/illustrator-discussions/trim-view-hides-guides/td-p/14066140), [guides greyed out](https://community.adobe.com/t5/illustrator-discussions/guides-greyed-out/m-p/11132728)). A drag or double-click on a ruler makes no guide while it is on (no preview, no undo step, a status message). `trim_view_hides_the_guides_and_the_grid`, `trim_view_deselects_selected_guide_paths`, `trim_view_makes_no_guide_from_the_rulers` in `crates/ui-egui/src/canvas/tests.rs`; `trim_view_greys_out_show_guides_and_show_grid` in `crates/ui-egui/src/menus/tests.rs`. - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. -- **Quick Pen tool (#2660, in part):** a tool in the Pen tool's group (Alt+P, Option+P on macOS) draws straight lines, continuous arcs and sharp-corner arcs, one undo step per piece; Alt pressed and let go on its own switches the action, C flips the last sharp-corner arc, `[` and `]` change the arc size by 15°, a click on the first point closes the path, a click on an open end continues it, and Escape or Enter ends it (`path.quickPen`), as [Draw with the Quick Pen tool](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.html) and [Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html) describe. The 180° default arc, its 15° steps, the side an arc bulges to, a dragged piece ending where the press is let go, and C, `[` and `]` changing the arc being dragged are VectorCraft's own rules. Tests: tools `quickpen::tests`, engine `tests::quickpen`, ui-egui `shortcuts::alt_tap::tests`, `alt_p_chooses_the_quick_pen_and_an_alt_tap_switches_its_action` and `brackets_size_the_quick_pen_arc_being_dragged`. Score and hours unchanged. +- **Quick Pen tool (#2660, in part):** a tool in the Pen tool's group (Alt+P, Option+P on macOS) draws straight lines, continuous arcs and sharp-corner arcs, one undo step per piece; Alt pressed and let go on its own switches the action, C flips the last sharp-corner arc, `[` and `]` and Ctrl with a touchpad scroll or a mouse wheel over the canvas change the arc size by 15° (`tool.quickPen.arcLarger`, `tool.quickPen.arcSmaller`), a click on the first point closes the path, a click on an open end continues it, and Escape or Enter ends it (`path.quickPen`), as [Draw with the Quick Pen tool](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.html) and [Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html) describe. The 180° default arc, its 15° steps, the side an arc bulges to, a dragged piece ending where the press is let go, C, `[` and `]` changing the arc being dragged, the mouse wheel changing the arc size, and one step per wheel event of a mouse wheel are VectorCraft's own rules. Tests: tools `quickpen::tests`, engine `tests::quickpen`, ui-egui `shortcuts::alt_tap::tests`, `tests::quickpenwheel`, `alt_p_chooses_the_quick_pen_and_an_alt_tap_switches_its_action` and `brackets_size_the_quick_pen_arc_being_dragged`. Score and hours unchanged. - **Optional compact Tools (#7234):** Window > Toolbars > Compact Tools reduces row and column spacing and the main panel's allocated width in one or two columns, docked or floating. The setting is saved with the UI state and applies to Basic, Advanced and edited main Tools layouts; the selected tool, icon size, footer controls and tool-flyout behavior are retained. Turning it off restores the existing layout, which remains the default. Named custom toolbars and flyout spacing are unchanged. Public regressions in `crates/ui-egui/tests/toolbar_compact.rs` cover the actual toolbar layout against the default control, the command and saved-state roundtrip, tool selection, flyouts, footer controls and short-window reachability. This is an optional layout choice, without a styling-parity or score claim; hours are unchanged. diff --git a/docs/ui-parity.md b/docs/ui-parity.md index 7d1d61416e..3acd3960a2 100644 --- a/docs/ui-parity.md +++ b/docs/ui-parity.md @@ -205,7 +205,7 @@ tools, never checked side by side) isn't captured row by row. | Busy cursor during long operations | done | Background open, save and export show the system progress cursor (gap G1) | | Each anchor snaps to Smart Guides and construction angles | done | `DrawSnap` | | Curvature tool: click/drag points, double-click or Alt-click for a corner, temporary Direct Selection, point conversion | partial | circular point markers without direction handles or duplicate markers, Anchor Size and Hide Edges regression-tested (#1236, in part); curve geometry: each stretch of three points follows the circle through them (handles along its tangent, chord/(3·cos²(α/2)) long, shorter in a turn tighter than 30°), open ends curving in, the same rule for the rubber band, dragged, inserted and converted points (#1236, in part); neighbours of a point dragged on an existing path keep their tangents, and modifiers requested in #975 remain | -| Quick Pen tool: straight lines, continuous arcs and sharp-corner arcs, Alt/Option to switch action, C to flip an arc, `[` / `]` for its size, Alt+P / Option+P, close on the first point, continue from an end, Escape to end ([help page](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.html), [shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html)) | partial | `path.quickPen` and the tool in `crates/tools/src/quickpen.rs`, in the Pen tool's group (#2660); the on-canvas toolbar with its actions, Flip Arc and its More menu (Hide Toolbar and Reset Toolbar Position, and VectorCraft's own Pin Toolbar Position) in `crates/ui-egui/src/canvas/quick_pen_bar.rs`. Not yet: dragging a path's ends to change a line's or arc's length, Ctrl+scroll for the arc size, and editing and deleting with the tool | +| Quick Pen tool: straight lines, continuous arcs and sharp-corner arcs, Alt/Option to switch action, C to flip an arc, `[` / `]` and Ctrl+scroll for its size, Alt+P / Option+P, close on the first point, continue from an end, Escape to end ([help page](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.html), [shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html)) | partial | `path.quickPen` and the tool in `crates/tools/src/quickpen.rs`, in the Pen tool's group (#2660); the on-canvas toolbar with its actions, Flip Arc and its More menu (Hide Toolbar and Reset Toolbar Position, and VectorCraft's own Pin Toolbar Position) in `crates/ui-egui/src/canvas/quick_pen_bar.rs`; Ctrl+scroll on a touchpad, and VectorCraft's own Ctrl+mouse wheel, over the canvas for the arc size in `crates/ui-egui/src/canvas/quick_pen_wheel.rs` (`tool.quickPen.arcLarger`, `tool.quickPen.arcSmaller`). Not yet: dragging a path's ends to change a line's or arc's length, and editing and deleting with the tool | | Icon-strip flyout resizing (#5713) | done | Canvas-side edge and bottom; user size persists after reopening and workspace restore; Glyphs and Artboards pointer/cursor regression | | Icon-strip flyout resizing from the top (storytold/craft-libs#1094) | done | Top edge (a 4 pt band over the tab strip) and the canvas-side top corner; the bottom and the icon-column edge stay; the moved top persists after reopening and workspace restore; `an_icon_flyout_grows_upward_from_its_top_edge_and_free_corner` | | Graphic Styles list fills a taller panel (#2992) | done | Docked, floating or in a resized flyout, the list takes the height above the panel's footer, as the Artboards list does; outside a sized panel it stays 220 pt; `the_list_fills_a_tall_panel_above_its_footer` | From e799a697703c3c1883c82a0094f56812cd6d7ba5 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Thu, 19 Nov 2026 20:12:18 -0800 Subject: [PATCH 02/11] Quick Pen: Ctrl+wheel steps the arc size in event order Each wheel event's whole steps now run before the next event's, and only the fraction of a wheel line carries over. A notch up refused at 345 degrees no longer cancels a notch down in the same frame, so the size goes to 330, and a touchpad gesture that starts later in a frame keeps the steps of the motion before it. A frame whose Ctrl+wheel event stepped the arc size no longer moves the view when a later event in the same frame starts a new turn. --- crates/ui-egui/src/canvas/quick_pen_wheel.rs | 43 +++++++++----- crates/ui-egui/src/tests/quickpenwheel.rs | 59 ++++++++++++++++++++ 2 files changed, 88 insertions(+), 14 deletions(-) diff --git a/crates/ui-egui/src/canvas/quick_pen_wheel.rs b/crates/ui-egui/src/canvas/quick_pen_wheel.rs index 6ba86ca852..129e234ee4 100644 --- a/crates/ui-egui/src/canvas/quick_pen_wheel.rs +++ b/crates/ui-egui/src/canvas/quick_pen_wheel.rs @@ -32,7 +32,7 @@ struct ArcWheel { const TURN_GAP: f64 = 0.150; const GESTURE_GAP: f64 = 1.0; -/// Most steps one frame makes: from 1° to 359° is fewer than 24 steps of 15°. +/// Most steps one wheel event makes: from 1° to 359° is fewer than 24 steps of 15°. const MOST_STEPS: i32 = 24; /// Ctrl alone (the Control key on macOS too). @@ -51,6 +51,11 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, ui: &Ui, over: bool) -> bool { let line = ui.ctx().options(|o| o.input_options.line_scroll_speed).max(1.0); let takes = over && app.session.tool_id() == vectorcraft_tools::quickpen::ID; let mut now = before; + // The steps to make, in event order: the command and how many times to run it. + let mut runs: Vec<(&str, i32)> = Vec::new(); + // Whether the tool took any of this frame's wheel events, even one of a turn that a later event + // of the frame ended: the view does not move for this frame's events then. + let mut took = false; let (any, scrolling) = ui.input(|i| { let mut any = false; for e in &i.events { @@ -80,6 +85,7 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, ui: &Ui, over: bool) -> bool { continue; } now.taken = true; + took = true; // Only Move events move, as egui's scroll; momentum after the fingers lift makes no step. if *phase != egui::TouchPhase::Move || *source == egui::MouseWheelSource::Momentum { continue; @@ -96,8 +102,18 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, ui: &Ui, over: bool) -> bool { } else { s }; - if d.is_finite() { - now.rest += d; + if !d.is_finite() { + continue; + } + // Each event's whole steps are made before the next event's, in the order the events + // came, so a step refused at an end of the range does not cancel a later step back; only + // the fraction of a wheel line is left for later motion. + now.rest += d; + let whole = now.rest.trunc(); + now.rest -= whole; + if whole != 0.0 { + let cmd = if whole > 0.0 { "tool.quickPen.arcLarger" } else { "tool.quickPen.arcSmaller" }; + runs.push((cmd, (whole.abs().min(MOST_STEPS as f32)) as i32)); } } (any, i.is_scrolling()) @@ -105,21 +121,20 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, ui: &Ui, over: bool) -> bool { if !any && !scrolling { now = ArcWheel::default(); } - let steps = now.rest.trunc(); - now.rest -= steps; - let (cmd, n) = if steps > 0.0 { ("tool.quickPen.arcLarger", steps) } else { ("tool.quickPen.arcSmaller", -steps) }; - for _ in 0..(n as i32).min(MOST_STEPS) { - match app.run(cmd, json!({})) { - Ok(serde_json::Value::Bool(true)) => {} - Ok(_) => break, - Err(e) => { - app.ui.status = e; - break; + 'runs: for (cmd, n) in runs { + for _ in 0..n { + match app.run(cmd, json!({})) { + Ok(serde_json::Value::Bool(true)) => {} + Ok(_) => break, + Err(e) => { + app.ui.status = e; + break 'runs; + } } } } if now != before { ui.data_mut(|d| d.insert_temp(id, now)); } - now.taken + now.taken || took } diff --git a/crates/ui-egui/src/tests/quickpenwheel.rs b/crates/ui-egui/src/tests/quickpenwheel.rs index 597035bc47..edf6940edb 100644 --- a/crates/ui-egui/src/tests/quickpenwheel.rs +++ b/crates/ui-egui/src/tests/quickpenwheel.rs @@ -363,6 +363,65 @@ fn ctrl_wheel_steps_per_notch_and_not_under_a_dialog() { assert_eq!(arc_size(&app), 180.0, "the rest of a turn begun under the dialog"); } +/// Wheel events in one frame step in the order they came: a notch up refused at the top of the +/// range does not cancel the notch down after it, and a touchpad gesture that starts later in the +/// frame keeps the steps of the motion before it and does not let that motion move the view. +#[test] +fn ctrl_wheel_steps_in_event_order() { + let mut app = app(); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + frame(&mut app, &ctx, vec![]); + app.run("tool.setOption", json!({"key": "turn", "value": 345})).unwrap(); + let ctrl = Modifiers { ctrl: true, command: true, ..Modifiers::NONE }; + let at = app.canvas_rect.unwrap().center(); + let notch = |dy: f32| Event::MouseWheel { + unit: MouseWheelUnit::Line, + delta: vec2(0.0, dy), + phase: egui::TouchPhase::Move, + modifiers: ctrl, + source: MouseWheelSource::Wheel, + }; + frame(&mut app, &ctx, vec![Event::PointerMoved(at), notch(1.0), notch(-1.0)]); + assert_eq!(arc_size(&app), 330.0, "up refused at 345°, then down"); + for _ in 0..40 { + frame(&mut app, &ctx, vec![]); + } + + let line = ctx.options(|o| o.input_options.line_scroll_speed); + let pad = |phase, dy: f32| Event::MouseWheel { + unit: MouseWheelUnit::Point, + delta: vec2(0.0, dy), + phase, + modifiers: ctrl, + source: MouseWheelSource::Trackpad, + }; + frame_at( + &mut app, + &ctx, + vec![pad(egui::TouchPhase::Start, 0.0), pad(egui::TouchPhase::Move, -line), pad(egui::TouchPhase::Start, 0.0)], + Some(500.0), + ); + assert_eq!(arc_size(&app), 315.0, "a line down before a later Start"); + for k in 1..=40 { + frame_at(&mut app, &ctx, vec![], Some(500.0 + f64::from(k) / 60.0)); + } + + // A Ctrl notch followed in the same frame by the Start of a touchpad gesture without Ctrl: the + // notch steps the arc size and does not move the view. + let still = view(&app); + let plain_start = Event::MouseWheel { + unit: MouseWheelUnit::Point, + delta: vec2(0.0, 0.0), + phase: egui::TouchPhase::Start, + modifiers: Modifiers::NONE, + source: MouseWheelSource::Trackpad, + }; + frame_at(&mut app, &ctx, vec![Event::PointerMoved(at), notch(1.0), plain_start], Some(600.0)); + assert_eq!(arc_size(&app), 330.0); + assert_eq!(view(&app), still, "the notch did not move the view"); +} + /// With another tool, Ctrl+wheel leaves the Quick Pen's arc size and moves the view as before. #[test] fn ctrl_wheel_with_another_tool_moves_the_view() { From c4df0b626fb7520e64b39cb82473c86a214517e2 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 22 Nov 2026 13:34:17 -0800 Subject: [PATCH 03/11] Quick Pen: keys tapped between touchpad wheel events count for the gesture During a touchpad gesture the held modifiers were taken only from wheel events, so Shift pressed and let go between two of them did not count and the next Ctrl-only event still stepped the arc size. While a gesture is under way, the modifiers of key events and modifier changes now join the gesture's held set in the order they come. The mouse-wheel path is unchanged. --- crates/ui-egui/src/canvas/quick_pen_wheel.rs | 8 +++ crates/ui-egui/src/tests/quickpenwheel.rs | 51 ++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/crates/ui-egui/src/canvas/quick_pen_wheel.rs b/crates/ui-egui/src/canvas/quick_pen_wheel.rs index 129e234ee4..8b036ada5d 100644 --- a/crates/ui-egui/src/canvas/quick_pen_wheel.rs +++ b/crates/ui-egui/src/canvas/quick_pen_wheel.rs @@ -59,6 +59,14 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, ui: &Ui, over: bool) -> bool { let (any, scrolling) = ui.input(|i| { let mut any = false; for e in &i.events { + // Keys pressed or let go between a touchpad gesture's wheel events count for the rest of + // the gesture too, in the order they came. + if let egui::Event::ModifiersChanged(m) | egui::Event::Key { modifiers: m, .. } = e { + if now.gesture { + now.held |= *m; + } + continue; + } let egui::Event::MouseWheel { unit, delta, phase, modifiers, source } = e else { continue }; any = true; // A wheel event after egui's scroll timeout, or a touchpad gesture's start, begins a diff --git a/crates/ui-egui/src/tests/quickpenwheel.rs b/crates/ui-egui/src/tests/quickpenwheel.rs index edf6940edb..4e5800c269 100644 --- a/crates/ui-egui/src/tests/quickpenwheel.rs +++ b/crates/ui-egui/src/tests/quickpenwheel.rs @@ -422,6 +422,57 @@ fn ctrl_wheel_steps_in_event_order() { assert_eq!(view(&app), still, "the notch did not move the view"); } +/// Shift pressed and let go between two wheel events of a touchpad gesture held with Ctrl counts for +/// the rest of the gesture, whether it comes as a key event or as a change of the held modifiers. +/// Between a mouse wheel's notches it does not. +#[test] +fn shift_tapped_between_touchpad_wheel_events_counts_for_the_gesture() { + let mut app = app(); + let ctx = egui::Context::default(); + frame(&mut app, &ctx, vec![]); + frame(&mut app, &ctx, vec![]); + let ctrl = Modifiers { ctrl: true, command: true, ..Modifiers::NONE }; + let both = Modifiers { shift: true, ..ctrl }; + let at = app.canvas_rect.unwrap().center(); + let line = ctx.options(|o| o.input_options.line_scroll_speed); + let pad = |phase, dy: f32| Event::MouseWheel { + unit: MouseWheelUnit::Point, + delta: vec2(0.0, dy), + phase, + modifiers: ctrl, + source: MouseWheelSource::Trackpad, + }; + let shift_key = |pressed, modifiers| Event::Key { key: egui::Key::ShiftLeft, physical_key: None, pressed, repeat: false, modifiers }; + let taps = [vec![shift_key(true, both), shift_key(false, ctrl)], vec![Event::ModifiersChanged(both), Event::ModifiersChanged(ctrl)]]; + let mut t = 700.0; + for tap in taps { + let size = arc_size(&app); + frame_at(&mut app, &ctx, vec![Event::PointerMoved(at), pad(egui::TouchPhase::Start, 0.0), pad(egui::TouchPhase::Move, line)], Some(t)); + assert_eq!(arc_size(&app), size + 15.0, "a line up with Ctrl"); + frame_at(&mut app, &ctx, tap.clone(), Some(t + 0.1)); + frame_at(&mut app, &ctx, vec![pad(egui::TouchPhase::Move, line)], Some(t + 0.2)); + assert_eq!(arc_size(&app), size + 15.0, "Shift tapped mid-gesture: {tap:?}"); + frame_at(&mut app, &ctx, vec![pad(egui::TouchPhase::End, 0.0)], Some(t + 0.3)); + for k in 1..=40 { + frame_at(&mut app, &ctx, vec![], Some(t + 0.3 + f64::from(k) / 60.0)); + } + t += 100.0; + } + + let size = arc_size(&app); + let notch = Event::MouseWheel { + unit: MouseWheelUnit::Line, + delta: vec2(0.0, 1.0), + phase: egui::TouchPhase::Move, + modifiers: ctrl, + source: MouseWheelSource::Wheel, + }; + frame_at(&mut app, &ctx, vec![Event::PointerMoved(at), notch.clone()], Some(t)); + frame_at(&mut app, &ctx, vec![shift_key(true, both), shift_key(false, ctrl)], Some(t + 0.05)); + frame_at(&mut app, &ctx, vec![notch], Some(t + 0.1)); + assert_eq!(arc_size(&app), size + 30.0, "two Ctrl notches around a Shift tap"); +} + /// With another tool, Ctrl+wheel leaves the Quick Pen's arc size and moves the view as before. #[test] fn ctrl_wheel_with_another_tool_moves_the_view() { From 60d16a5561581933565a5735c11dd7afbadb52c7 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sat, 28 Nov 2026 22:20:43 -0800 Subject: [PATCH 04/11] Quick Pen: the arc-size wheel reads the framework's gesture, held keys and modal mark The Ctrl-wheel arc size now reads everything from the canvas's share of the craft wheel: its lines, its gesture's motion, the keys held during the gesture (held) and whether a modal layer held the turn (modal). The tool keeps no wheel timers or raw-event reads of its own. A turn the app's own modal window was up for stays muted until the framework starts a new gesture. Zoom-modifier motion adds both axes, as the zoom factor does. Pins craft-libs to the head of storytold/craft-libs#4220, which adds Wheel::held and Wheel::modal. --- Cargo.lock | 170 +++++++-------- Cargo.toml | 70 +++---- apps/vectorcraft-web/Cargo.toml | 2 +- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/canvas/quick_pen_wheel.rs | 209 +++++++------------ 5 files changed, 194 insertions(+), 259 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 520647b95d..74557685f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1239,7 +1239,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1280,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "crc32fast", "flate2", @@ -1291,7 +1291,7 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "block2 0.6.2", "objc2 0.6.5", @@ -1302,7 +1302,7 @@ dependencies = [ [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1310,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1335,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1353,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1371,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1380,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "egui", ] @@ -1388,7 +1388,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "md-5", "rayon", @@ -1397,12 +1397,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1422,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1433,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1443,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "rayon", ] @@ -1451,7 +1451,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1493,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "serde", ] @@ -1501,7 +1501,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1520,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "serde", "serde_json", @@ -1542,12 +1542,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1562,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1581,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1590,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1613,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "gif", ] @@ -1626,7 +1626,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "flate2", ] @@ -1634,7 +1634,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,7 +1647,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "chrono", "fixed_decimal", @@ -1675,7 +1675,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1702,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1720,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1728,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1754,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1768,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1798,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1809,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "chrono", "craft-codepage", @@ -1819,7 +1819,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-keymap", @@ -1835,7 +1835,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "flate2", "serde", @@ -1846,7 +1846,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1858,7 +1858,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "async-channel", "async-io", @@ -1889,7 +1889,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1898,7 +1898,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-host", @@ -1922,7 +1922,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1933,7 +1933,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-eps", "flate2", @@ -1947,7 +1947,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "encoding_rs", "flate2", @@ -1958,7 +1958,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "dispatch2", "egui", @@ -1971,7 +1971,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1990,7 +1990,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-atomic", "craft-host", @@ -2007,7 +2007,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "fax", "hayro-ccitt", @@ -2018,7 +2018,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2039,7 +2039,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-keymap", @@ -2051,7 +2051,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2076,7 +2076,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2091,7 +2091,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-atomic", "craft-behavior", @@ -2106,7 +2106,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "serde", "thiserror 2.0.21", @@ -2116,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "serde", "thiserror 2.0.21", @@ -2125,7 +2125,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-keymap", @@ -2140,12 +2140,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2159,7 +2159,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-i18n", @@ -2175,7 +2175,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "accesskit", "craft-behavior", @@ -2213,7 +2213,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2224,7 +2224,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-host", @@ -2242,7 +2242,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-host", @@ -2263,7 +2263,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2284,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2303,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "base64 0.22.1", "chrono", @@ -2335,7 +2335,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "flate2", "serde", @@ -2346,7 +2346,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2356,7 +2356,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "js-sys", "serde_json", @@ -2367,7 +2367,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "winsafe", ] @@ -2375,7 +2375,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "craft-appkit", "craft-atomic", @@ -2407,7 +2407,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3762,7 +3762,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "brotli", "hayro-postscript", @@ -3771,7 +3771,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3789,7 +3789,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3807,12 +3807,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "flate2", "hayro-ccitt", @@ -4795,7 +4795,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4952,7 +4952,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=610c86792a02aa3d416926ee44e3ec3788dea853#610c86792a02aa3d416926ee44e3ec3788dea853" +source = "git+https://github.com/storytold/craft-libs?rev=bb7cc548d286085f2d288445123ec3679248da86#bb7cc548d286085f2d288445123ec3679248da86" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index a0fb986dcc..07d9278067 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,46 +11,46 @@ rust-version = "1.95" repository = "https://github.com/storytold/vectorcraft" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } # internal vectorcraft-geom = { path = "crates/geom" } vectorcraft-color = { path = "crates/color" } @@ -193,13 +193,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } emath = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } epaint = { git = "https://github.com/storytold/egui.git", rev = "932a73b28560acb1a695533307b2cd0d66a42081" } diff --git a/apps/vectorcraft-web/Cargo.toml b/apps/vectorcraft-web/Cargo.toml index e8b56c29a9..687140ce2b 100644 --- a/apps/vectorcraft-web/Cargo.toml +++ b/apps/vectorcraft-web/Cargo.toml @@ -27,7 +27,7 @@ log = { workspace = true } # `wgpu` pulls egui-wgpu's defaults: WebGPU plus the WebGL2 fallback. eframe = { workspace = true, features = ["default_fonts", "wgpu", "accesskit"] } # The page command API (storytold/craft-libs#413): the request plumbing behind window.vectorcraft. -craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "610c86792a02aa3d416926ee44e3ec3788dea853", version = "0.1.0" } +craft-web-api = { git = "https://github.com/storytold/craft-libs", rev = "bb7cc548d286085f2d288445123ec3679248da86", version = "0.1.0" } wasm-bindgen = "0.2" serde_json = { workspace = true } diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index fe2cbb7504..965c06f3b1 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -328,7 +328,7 @@ fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: O let task_bar = (app.ui.task_bar && !revolve_editing(app) && !strip && !dragging).then(|| task_bar::task_bar(app, ui, space)).flatten(); let bar = quick_pen_bar::quick_pen_bar(app, ui, space); // A Ctrl-wheel turn with the Quick Pen tool changes its arc size; the view stays as it was before the pass. - out.arc_turn = quick_pen_wheel::arc_size(app, ui, space.wheel(), bar); + out.arc_turn = quick_pen_wheel::arc_size(app, space.wheel(), bar); contour_bar::contour_bar(app, ui, space); // After the task bar, which the row of character alternates keeps clear of. alternates_bar::alternates_bar(app, ui, space, task_bar); diff --git a/crates/ui-egui/src/canvas/quick_pen_wheel.rs b/crates/ui-egui/src/canvas/quick_pen_wheel.rs index 6a5b43de78..06ee24dd50 100644 --- a/crates/ui-egui/src/canvas/quick_pen_wheel.rs +++ b/crates/ui-egui/src/canvas/quick_pen_wheel.rs @@ -4,53 +4,27 @@ //! and on macOS alike //! ([Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html)). //! VectorCraft's own rules: a mouse wheel turned with Ctrl does the same; a mouse wheel makes one -//! step of 15°, as `[` and `]` do, for each notch (each whole wheel line, at least one for each pass +//! step of 15°, as `[` and `]` do, for each notch (each whole wheel line, at least one for each share //! of wheel motion the canvas reads), and a touchpad makes one step for each wheel line of its -//! motion; up makes the arc larger and down smaller, and sideways motion makes no step (with Ctrl on -//! Windows and Linux, where the wheel reaches the canvas as a zoom, sideways motion counts as up and -//! down); momentum after the fingers lift makes no step; and a turn ends after [`GESTURE_GAP`] -//! without a wheel event, as the framework's wheel gestures do, or after 1 s without one while a -//! touchpad gesture is under way. +//! gesture's motion; up makes the arc larger and down smaller, and sideways motion makes no step +//! (with Ctrl on Windows and Linux, where the wheel reaches the canvas as a zoom, sideways motion +//! counts as up and down); and momentum after the fingers lift makes no step. +//! +//! Everything here is read from the canvas's share of the framework's wheel (`space.wheel()`): its +//! modifiers, its device, its motion in lines (`lines`, or `zoom_lines` for a wheel that reaches the +//! canvas as a zoom), its gesture's motion so far (`gathered`, `zoom_gathered`), the keys held during +//! the gesture (`held`) and whether the gesture began under a modal window (`modal`). -use craft::behavior::{GESTURE_GAP, Wheel, WheelSource, WheelUnit}; +use craft::behavior::{Wheel, WheelSource, WheelUnit}; use craft::keymap::{Mods, Platform}; -use super::{Ui, VectorcraftApp, json}; - -/// A wheel turn the Quick Pen tool may take: the touchpad's motion, in wheel lines, not yet turned -/// into a step; whether the tool took the turn; whether the turn began under a modal window; -/// whether a touchpad gesture is under way (between its Start and End phases); when the turn's last -/// wheel event came (egui's input time); and the modifiers the gesture holds. -#[derive(Clone, Copy, Default, PartialEq)] -struct ArcWheel { - rest: f32, - taken: bool, - muted: bool, - gesture: bool, - last: f64, - held: Mods, -} - -/// What a pass's own wheel events say: whether any came, the modifiers of a touchpad gesture's -/// Start among them, and whether the gesture ended after it. -#[derive(Default)] -struct RawWheel { - any: bool, - start: Option, - end: bool, -} - -/// Seconds without a wheel event after which a wheel event starts a new turn while a touchpad -/// gesture is under way (fingers resting mid-gesture); outside a gesture it is [`GESTURE_GAP`]. -const RESTING_GAP: f64 = 1.0; +use super::{VectorcraftApp, json}; /// Most steps one share of the wheel makes: from 1° to 359° is fewer than 24 steps of 15°. const MOST_STEPS: f32 = 24.0; -/// The modifiers held in `a` or in `b`. -fn either(a: Mods, b: Mods) -> Mods { - Mods { cmd: a.cmd || b.cmd, ctrl: a.ctrl || b.ctrl, alt: a.alt || b.alt, shift: a.shift || b.shift } -} +/// How far a line's worth of motion may fall short of a whole line and still count as one. +const LINE_SLACK: f32 = 1e-3; /// The Control key alone: Ctrl on Windows and Linux, which the keymap folds into `cmd`, and the /// Control key on macOS, where `cmd` is ⌘. @@ -59,27 +33,29 @@ fn ctrl_alone(m: Mods, os: Platform) -> bool { control && !(m.alt || m.shift) } -/// How far a line's worth of motion may fall short of a whole line and still count as one: a zoom -/// factor turned back into lines carries rounding. -const LINE_SLACK: f32 = 1e-3; - -/// The wheel's up and down motion in wheel lines, up positive. A wheel turned with egui's zoom -/// modifier (Ctrl on Windows and Linux) reaches the canvas as a zoom factor and no scroll, and so -/// does a touchpad's Ctrl+scroll there, which the framework reads as a pinch; the motion is read -/// back from the factor in lines of egui's `line_scroll_speed` points, at `scroll_zoom_speed` per -/// point, as egui and the framework made it. Points of a touchpad or a browser are lines of `line` -/// points. A wheel turned with the zoom modifier sideways counts as up and down: the factor does -/// not tell the two apart. -fn lines(wheel: &Wheel, ctx: &egui::Context, line: f32) -> f32 { - let lines = if wheel.scroll.y != 0.0 { +/// The share's up and down motion in wheel lines, up positive. A wheel turned with egui's zoom +/// modifier (Ctrl on Windows and Linux) reaches the canvas as a zoom, and the framework counts its +/// lines in `zoom_lines`; sideways motion there adds to up and down, as egui's zoom factor does. +/// Points of a touchpad or a browser are lines of `line` points. +fn lines(wheel: &Wheel, line: f32) -> f32 { + let d = if wheel.zoom_lines != egui::Vec2::ZERO { + wheel.zoom_lines.x + wheel.zoom_lines.y + } else if wheel.scroll.y != 0.0 { if wheel.unit == WheelUnit::Line { wheel.lines.y } else { wheel.scroll.y / line } - } else if wheel.scroll == egui::Vec2::ZERO && wheel.zoom.is_finite() && wheel.zoom > 0.0 && wheel.zoom != 1.0 { - let (speed, egui_line) = ctx.options(|o| (o.input_options.scroll_zoom_speed, o.input_options.line_scroll_speed)); - wheel.zoom.ln() / speed / egui_line } else { 0.0 }; - if lines.is_finite() { lines } else { 0.0 } + if d.is_finite() { d } else { 0.0 } +} + +/// A wheel turn the Quick Pen tool reads, from the framework's gesture: whether a modal window was up +/// during it, whether the tool took it, and the touchpad motion it took, in wheel lines, not yet +/// turned into a step. +#[derive(Clone, Copy, Default, PartialEq)] +struct ArcTurn { + muted: bool, + taken: bool, + rest: f32, } /// Whether `wheel`, of `lines` wheel lines, comes from a touchpad and not from a mouse wheel's @@ -96,99 +72,61 @@ fn fine(wheel: &Wheel, lines: f32) -> bool { } } +/// Whole lines in `v`, toward zero, with [`LINE_SLACK`] for rounding. +fn whole(v: f32) -> f32 { + (v + LINE_SLACK * v.signum()).trunc() +} + /// The steps `wheel` makes, up positive: a mouse wheel's whole lines, at least one; one for a share -/// of points or pages from a mouse; and a touchpad's motion in wheel lines of `line` points, with -/// the fraction kept in `rest` for later motion. Momentum after the fingers lift makes no step. -fn steps(wheel: &Wheel, ctx: &egui::Context, line: f32, rest: &mut f32) -> f32 { +/// of points or pages from a mouse; and for a touchpad the whole lines of the motion the tool took in +/// this turn, with the fraction kept in `rest`. Momentum after the fingers lift makes no step. +fn steps(wheel: &Wheel, line: f32, rest: &mut f32) -> f32 { if wheel.source == WheelSource::Momentum { return 0.0; } - let d = lines(wheel, ctx, line); + let d = lines(wheel, line); if d == 0.0 { return 0.0; } if fine(wheel, d) { *rest += d; - let whole = (*rest + LINE_SLACK * rest.signum()).trunc(); - *rest -= whole; - return whole.clamp(-MOST_STEPS, MOST_STEPS); + let steps = whole(*rest); + *rest -= steps; + return steps.clamp(-MOST_STEPS, MOST_STEPS); } - let whole = if wheel.unit == WheelUnit::Line { (d.abs() + LINE_SLACK).trunc() } else { 1.0 }; - d.signum() * whole.clamp(1.0, MOST_STEPS) + let notches = if wheel.unit == WheelUnit::Line { (d.abs() + LINE_SLACK).trunc() } else { 1.0 }; + d.signum() * notches.clamp(1.0, MOST_STEPS) } /// With the Quick Pen tool active, the wheel share the canvas read this pass (`wheel`), turned with /// the Control key alone and not over the Quick Pen toolbar (`bar`), makes the arc size larger (up) -/// or smaller (down). The modifiers held at any point of a touchpad gesture count until it ends, -/// keys tapped between its wheel events included. No step is made while a modal window is up, nor -/// for the rest of a turn begun under one. Returns true while the tool takes the turn, so the view -/// does not zoom or scroll for the rest of it. -pub(super) fn arc_size(app: &mut VectorcraftApp, ui: &Ui, wheel: Option, bar: Option) -> bool { - let id = egui::Id::unique("quick-pen-arc-wheel"); - let before: ArcWheel = ui.data(|d| d.get_temp(id)).unwrap_or_default(); - let os = crate::keymap::platform(); - let mut now = before; - // The pass's own events: the keys, and the wheel's events with the phases of a touchpad gesture, - // which the canvas's share does not carry when they move nothing (a gesture's Start). - let (time, raw, keys) = ui.input(|i| { - let mut keys = Mods::NONE; - let mut raw = RawWheel::default(); - for e in &i.events { - match e { - egui::Event::ModifiersChanged(m) | egui::Event::Key { modifiers: m, .. } => keys = either(keys, Mods::from_egui(m, os)), - // The framework's pinch from a Ctrl+wheel on Windows and Linux. - egui::Event::Zoom(_) => raw.any = true, - egui::Event::MouseWheel { phase, modifiers, .. } => { - raw.any = true; - match phase { - egui::TouchPhase::Start => { - raw.start = Some(either(raw.start.unwrap_or(Mods::NONE), Mods::from_egui(modifiers, os))); - raw.end = false; - } - egui::TouchPhase::End | egui::TouchPhase::Cancel => raw.end = true, - egui::TouchPhase::Move => {} - } - } - _ => {} - } - } - (i.time, raw, keys) - }); - let gap = if now.gesture { RESTING_GAP } else { GESTURE_GAP }; - if raw.any && (time - now.last > gap || raw.start.is_some()) { - // A wheel event after the gap, or a touchpad gesture's start, begins a new turn: what the - // turn before it took and left over goes. - now = ArcWheel::default(); - } - if let Some(m) = raw.start { - now.gesture = true; - now.held = m; - } - if now.gesture { - now.held = either(now.held, keys); - } - if raw.any { - now.last = time; - } - // The canvas reads no wheel under a modal window: a turn that goes on there makes no step after - // the window closes either. - let modal = crate::panel_docking::modal_window_up(app); - if modal && raw.any { - now.muted = true; - } - let mut runs = 0.0; +/// or smaller (down). A touchpad gesture counts the keys held at any point of it, keys tapped +/// between its events included. No step is made while a modal window is up, nor for the rest of a +/// turn begun under one. Returns true while the tool takes the turn, so the view does not zoom or +/// scroll for the rest of it. A turn is the framework's wheel gesture. +pub(super) fn arc_size(app: &mut VectorcraftApp, wheel: Option, bar: Option) -> bool { + let Some(w) = wheel else { return false }; + let id = egui::Id::unique("quick-pen-arc-turn"); + // The framework's first share of a gesture gathers only itself. + let first = w.gathered == w.scroll && w.zoom_gathered == w.zoom_lines; + let before = if first { ArcTurn::default() } else { app.ui_ctx.as_ref().and_then(|ctx| ctx.data(|d| d.get_temp(id))).unwrap_or_default() }; + let mut turn = before; + // The framework marks a turn a modal layer held (`modal`); a turn that reached the canvas while + // one of the app's own modal windows was up stays muted until the framework starts a new one. + turn.muted |= w.modal || crate::panel_docking::modal_window_up(app); + let line = crate::app::view::navigation(&app.session.prefs).wheel_line.max(1.0); + let mods = if fine(&w, lines(&w, line)) { w.held } else { w.mods }; + let over_bar = w.at.zip(bar).is_some_and(|(at, bar)| bar.contains(at)); let quick_pen = app.session.tool_id() == vectorcraft_tools::quickpen::ID; - if let Some(w) = wheel.filter(|_| !modal) { - now.held = if now.gesture { either(now.held, w.mods) } else { w.mods }; - let over_bar = w.at.zip(bar).is_some_and(|(at, bar)| bar.contains(at)); - if quick_pen && !now.muted && !over_bar && ctrl_alone(now.held, os) { - now.taken = true; - let line = crate::app::view::navigation(&app.session.prefs).wheel_line.max(1.0); - runs = steps(&w, ui.ctx(), line, &mut now.rest); - } + let mut runs = 0.0; + if quick_pen && !turn.muted && !over_bar && ctrl_alone(mods, crate::keymap::platform()) { + turn.taken = true; + runs = steps(&w, line, &mut turn.rest); } - if raw.end { - now.gesture = false; + if (first || turn != before) + && let Some(ctx) = &app.ui_ctx + { + ctx.data_mut(|d| d.insert_temp(id, turn)); } let cmd = if runs > 0.0 { "tool.quickPen.arcLarger" } else { "tool.quickPen.arcSmaller" }; for _ in 0..(runs.abs() as u32) { @@ -201,8 +139,5 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, ui: &Ui, wheel: Option, } } } - if now != before { - ui.data_mut(|d| d.insert_temp(id, now)); - } - quick_pen && wheel.is_some() && now.taken + quick_pen && turn.taken } From 411abb2f86621db04d3c242ab53eee39bb70adc6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 21:54:37 -0800 Subject: [PATCH 05/11] Quick Pen: Ctrl+wheel arc size reads the framework's wheel claims The arc size keeps no per-gesture state of its own: each share the tool reads is claimed with CanvasSpace::claim_wheel, the touchpad motion not yet turned into a step rides in claimed_spent, and an app modal window marks the gesture with mark_wheel_modal. craft-libs moves to main at 5190e08ab, which has the wheel claim API (craft-libs #4373). --- Cargo.lock | 207 +++++++++---------- Cargo.toml | 74 +++---- crates/ui-egui/src/canvas.rs | 2 +- crates/ui-egui/src/canvas/quick_pen_wheel.rs | 55 +++-- 4 files changed, 165 insertions(+), 173 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4fce3ecad1..4f79f80d81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -626,12 +626,6 @@ dependencies = [ "cpufeatures 0.3.1", ] -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - [[package]] name = "block-buffer" version = "0.10.4" @@ -725,6 +719,17 @@ dependencies = [ "brotli-decompressor 5.0.3", ] +[[package]] +name = "brotli" +version = "9.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9071f285ed78f04f37d675abaaef5de7689e2f30a216c8dc6795465d81910a13" +dependencies = [ + "alloc-no-stdlib 3.0.0", + "alloc-stdlib 0.3.0", + "brotli-decompressor 6.3.2", +] + [[package]] name = "brotli-decompressor" version = "5.0.3" @@ -1184,19 +1189,6 @@ dependencies = [ "libc", ] -[[package]] -name = "core-graphics2" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b65858d95344d2711161cd92196732f67d6c5fea238cf12f994584828731a5c" -dependencies = [ - "bitflags 2.13.2", - "block", - "cfg-if", - "core-foundation 0.10.1", - "libc", -] - [[package]] name = "core_detect" version = "1.0.0" @@ -1239,7 +1231,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-automation", "craft-behavior", @@ -1280,7 +1272,7 @@ dependencies = [ [[package]] name = "craft-affinity" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "crc32fast", "flate2", @@ -1291,18 +1283,19 @@ dependencies = [ [[package]] name = "craft-appkit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "block2 0.6.2", "objc2 0.6.5", "objc2-app-kit 0.3.2", + "objc2-core-graphics", "objc2-foundation 0.3.2", ] [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "rustix 1.1.6", ] @@ -1310,7 +1303,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1335,7 +1328,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1353,7 +1346,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-docpath", @@ -1371,7 +1364,7 @@ dependencies = [ [[package]] name = "craft-cdr" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "crc32fast", "flate2", @@ -1380,7 +1373,7 @@ dependencies = [ [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "egui", ] @@ -1388,7 +1381,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "md-5", "rayon", @@ -1397,12 +1390,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-cms", @@ -1422,7 +1415,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-control-protocol", "craft-platform", @@ -1433,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-control-protocol" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "getrandom 0.3.4", "serde_json", @@ -1443,7 +1436,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "rayon", ] @@ -1451,7 +1444,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "block2 0.6.2", "craft-appkit", @@ -1477,7 +1470,7 @@ dependencies = [ [[package]] name = "craft-doc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "blake3", "craft-ecproj-format", @@ -1493,7 +1486,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "serde", ] @@ -1501,7 +1494,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1520,7 +1513,7 @@ dependencies = [ [[package]] name = "craft-dxf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-codepage", "encoding_rs", @@ -1532,7 +1525,7 @@ dependencies = [ [[package]] name = "craft-ecproj-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "serde", "serde_json", @@ -1542,12 +1535,12 @@ dependencies = [ [[package]] name = "craft-eps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1562,7 +1555,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1581,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-font-os-windows" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "windows-registry", "windows-sys 0.61.2", @@ -1590,7 +1583,7 @@ dependencies = [ [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "cap-primitives", "craft-atomic", @@ -1613,12 +1606,12 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" [[package]] name = "craft-gif" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "gif", ] @@ -1626,7 +1619,7 @@ dependencies = [ [[package]] name = "craft-gzip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "flate2", ] @@ -1634,7 +1627,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1647,8 +1640,10 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ + "brotli 9.1.3", + "brotli-decompressor 6.3.2", "chrono", "fixed_decimal", "icu_calendar", @@ -1675,7 +1670,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-dds", "craft-jpeg", @@ -1702,7 +1697,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1720,7 +1715,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "thiserror 2.0.21", ] @@ -1728,7 +1723,7 @@ dependencies = [ [[package]] name = "craft-jxl" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "brotli-decompressor 5.0.3", "jixel", @@ -1739,7 +1734,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-host", "craft-i18n", @@ -1754,7 +1749,7 @@ dependencies = [ [[package]] name = "craft-layers" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-i18n", @@ -1768,7 +1763,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-host", @@ -1786,7 +1781,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "brotli-decompressor 6.3.2", "chrono", @@ -1798,7 +1793,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "encoding_rs", "image", @@ -1809,7 +1804,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "chrono", "craft-codepage", @@ -1827,7 +1822,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-keymap", @@ -1843,7 +1838,7 @@ dependencies = [ [[package]] name = "craft-pcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "flate2", "serde", @@ -1854,7 +1849,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "hayro-interpret", "hayro-syntax", @@ -1866,12 +1861,12 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "async-channel", "async-io", "async-process", - "core-graphics2", + "craft-appkit", "craft-atomic", "craft-docpath", "craft-host", @@ -1881,6 +1876,8 @@ dependencies = [ "js-sys", "log", "objc2-app-kit 0.3.2", + "objc2-core-foundation", + "objc2-core-graphics", "rfd", "serde", "serde_json", @@ -1897,7 +1894,7 @@ dependencies = [ [[package]] name = "craft-plotter" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "kurbo 0.13.1", "thiserror 2.0.21", @@ -1906,7 +1903,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-host", @@ -1930,7 +1927,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1941,7 +1938,7 @@ dependencies = [ [[package]] name = "craft-ps" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-eps", "flate2", @@ -1955,7 +1952,7 @@ dependencies = [ [[package]] name = "craft-psd" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "encoding_rs", "flate2", @@ -1966,7 +1963,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "dispatch2", "egui", @@ -1979,7 +1976,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1998,7 +1995,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-atomic", "craft-host", @@ -2015,7 +2012,7 @@ dependencies = [ [[package]] name = "craft-stream-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "fax", "hayro-ccitt", @@ -2026,7 +2023,7 @@ dependencies = [ [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-image-codecs", "craft-xml", @@ -2047,7 +2044,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-keymap", @@ -2059,7 +2056,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-font-manager", @@ -2084,7 +2081,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2099,7 +2096,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-atomic", "craft-behavior", @@ -2114,7 +2111,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "serde", "thiserror 2.0.21", @@ -2124,7 +2121,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "serde", "thiserror 2.0.21", @@ -2133,7 +2130,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-keymap", @@ -2148,12 +2145,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2167,7 +2164,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-i18n", @@ -2183,7 +2180,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "accesskit", "craft-behavior", @@ -2221,7 +2218,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2232,7 +2229,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-host", @@ -2250,7 +2247,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-host", @@ -2271,7 +2268,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-host", @@ -2292,7 +2289,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-behavior", "craft-host", @@ -2311,7 +2308,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "base64 0.22.1", "chrono", @@ -2343,7 +2340,7 @@ dependencies = [ [[package]] name = "craft-vectorcraft-format" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "flate2", "serde", @@ -2354,7 +2351,7 @@ dependencies = [ [[package]] name = "craft-wayland" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "raw-window-handle", "wayland-backend", @@ -2375,7 +2372,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "winsafe", ] @@ -2383,7 +2380,7 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "craft-appkit", "craft-atomic", @@ -2415,7 +2412,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "quick-xml 0.41.0", "serde", @@ -3770,16 +3767,16 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ - "brotli", + "brotli 8.0.4", "hayro-postscript", ] [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3797,7 +3794,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3815,12 +3812,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "flate2", "hayro-ccitt", @@ -4803,7 +4800,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4960,7 +4957,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=186a229c8da8db5916f8a863dfd894f1879af735#186a229c8da8db5916f8a863dfd894f1879af735" +source = "git+https://github.com/storytold/craft-libs?rev=5190e08ab8ef93c0abdfce2790a34cc0c377b3b6#5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" dependencies = [ "arrayvec", "kurbo 0.13.1", diff --git a/Cargo.toml b/Cargo.toml index cc76d129c5..a3e05e0732 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,49 +10,49 @@ license = "MIT OR Apache-2.0" rust-version = "1.95" [workspace.dependencies] -craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["interpret", "write"] } -craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cms = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6", default-features = false, features = ["interpret", "write"] } +craft-docpath = { version = "0.1.0", git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-proof = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # Language packs: the Craft apps' shared font store installs them (#4936). -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # The `.vectorcraft` envelope: its members, version, embedded images and the data after the JSON. -craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-vectorcraft-format = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-gzip = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # `.pcraft` documents: their manifest, full-size composite, preview, layer pixels and ICC profile. -craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["pcraft-pixels"] } +craft-doc = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6", features = ["pcraft-pixels"] } # Native Affinity documents (craft-libs#914). -craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-affinity = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # Bounded CDR (v1-v27) and CMX (32-bit) reader (craft-libs#778). -craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-cdr = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # SVG parsing, limits, SVGZ and writer (craft-libs#778). -craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", features = ["tree"] } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-svg = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6", features = ["tree"] } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # EPS container, previews, ASCII85 and DSC comments (craft-libs#778). -craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-eps = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # DXF tags, reader and writer (craft-libs#778, #926, #927). -craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-plotter = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-dxf = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # WMF, EMF and EMF+ reader (craft-libs#778). -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735", default-features = false, features = ["read", "write"] } -craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-gif = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-ps = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6", default-features = false, features = ["read", "write"] } +craft-psd = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-stream-codecs = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-jxl = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # The framework facade (`craft::ui`, `craft::settings`, `craft::platform`, ...). No default features: each crate names # the members it imports. -craft = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # Below the egui layer, so not through the facade: the colour harmony rules and their settings (craft-color-ui # without its `ui` feature), the colour type they work in, and the craft-fonts tables the text crate's build writes. -craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +craft-color-ui = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-theme = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } # Nightly profile isolation, launch protocol, and security fence. craft-nightly = { git = "https://github.com/storytold/craft-libs", rev = "1f6c3a21f85ed96f8fd4ddd5a959d4e1edbedb24" } # internal @@ -194,13 +194,13 @@ lto = "thin" codegen-units = 1 [patch.crates-io] -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -krilla = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "186a229c8da8db5916f8a863dfd894f1879af735" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "5190e08ab8ef93c0abdfce2790a34cc0c377b3b6" } ecolor = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } emath = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } epaint = { git = "https://github.com/storytold/egui.git", rev = "14c39fed181756be6f357c284354e0ab55b64443" } diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 84bb417676..34b6d7e5df 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -329,7 +329,7 @@ fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: O let task_bar = (app.ui.task_bar && !revolve_editing(app) && !strip && !dragging).then(|| task_bar::task_bar(app, ui, space)).flatten(); let bar = quick_pen_bar::quick_pen_bar(app, ui, space); // A Ctrl-wheel turn with the Quick Pen tool changes its arc size; the view stays as it was before the pass. - out.arc_turn = quick_pen_wheel::arc_size(app, space.wheel(), bar); + out.arc_turn = quick_pen_wheel::arc_size(app, ui.ctx(), space, bar); contour_bar::contour_bar(app, ui, space); // After the task bar, which the row of character alternates keeps clear of. alternates_bar::alternates_bar(app, ui, space, task_bar); diff --git a/crates/ui-egui/src/canvas/quick_pen_wheel.rs b/crates/ui-egui/src/canvas/quick_pen_wheel.rs index 06ee24dd50..b66ad3963e 100644 --- a/crates/ui-egui/src/canvas/quick_pen_wheel.rs +++ b/crates/ui-egui/src/canvas/quick_pen_wheel.rs @@ -17,6 +17,7 @@ use craft::behavior::{Wheel, WheelSource, WheelUnit}; use craft::keymap::{Mods, Platform}; +use craft::ui::canvas::CanvasSpace; use super::{VectorcraftApp, json}; @@ -48,16 +49,6 @@ fn lines(wheel: &Wheel, line: f32) -> f32 { if d.is_finite() { d } else { 0.0 } } -/// A wheel turn the Quick Pen tool reads, from the framework's gesture: whether a modal window was up -/// during it, whether the tool took it, and the touchpad motion it took, in wheel lines, not yet -/// turned into a step. -#[derive(Clone, Copy, Default, PartialEq)] -struct ArcTurn { - muted: bool, - taken: bool, - rest: f32, -} - /// Whether `wheel`, of `lines` wheel lines, comes from a touchpad and not from a mouse wheel's /// notches. egui names the source on macOS and reports it unknown elsewhere. There, point motion /// (Wayland, a Windows precision touchpad) and line motion that is not whole lines (Windows and X11) @@ -103,30 +94,34 @@ fn steps(wheel: &Wheel, line: f32, rest: &mut f32) -> f32 { /// or smaller (down). A touchpad gesture counts the keys held at any point of it, keys tapped /// between its events included. No step is made while a modal window is up, nor for the rest of a /// turn begun under one. Returns true while the tool takes the turn, so the view does not zoom or -/// scroll for the rest of it. A turn is the framework's wheel gesture. -pub(super) fn arc_size(app: &mut VectorcraftApp, wheel: Option, bar: Option) -> bool { - let Some(w) = wheel else { return false }; - let id = egui::Id::unique("quick-pen-arc-turn"); - // The framework's first share of a gesture gathers only itself. - let first = w.gathered == w.scroll && w.zoom_gathered == w.zoom_lines; - let before = if first { ArcTurn::default() } else { app.ui_ctx.as_ref().and_then(|ctx| ctx.data(|d| d.get_temp(id))).unwrap_or_default() }; - let mut turn = before; - // The framework marks a turn a modal layer held (`modal`); a turn that reached the canvas while - // one of the app's own modal windows was up stays muted until the framework starts a new one. - turn.muted |= w.modal || crate::panel_docking::modal_window_up(app); +/// scroll for the rest of it. A turn is the framework's wheel gesture, and the tool keeps no state of +/// its own: it claims each share it reads (`CanvasSpace::claim_wheel`), recording as `spent.x` the +/// touchpad motion it kept, in wheel lines, so `claimed_spent.x` is the motion of the turn not yet +/// turned into a step. +pub(super) fn arc_size(app: &mut VectorcraftApp, ctx: &egui::Context, space: &CanvasSpace, bar: Option) -> bool { + let Some(w) = space.wheel() else { return false }; + // The framework marks a turn a modal layer held (`modal`); a turn that reaches the canvas while one + // of the app's own modal windows is up is marked too, and stays muted until the framework starts a + // new one. + let app_modal = crate::panel_docking::modal_window_up(app); + if app_modal { + space.mark_wheel_modal(ctx); + } + let muted = w.modal || app_modal; let line = crate::app::view::navigation(&app.session.prefs).wheel_line.max(1.0); let mods = if fine(&w, lines(&w, line)) { w.held } else { w.mods }; let over_bar = w.at.zip(bar).is_some_and(|(at, bar)| bar.contains(at)); let quick_pen = app.session.tool_id() == vectorcraft_tools::quickpen::ID; + let mut taken = w.claimed; let mut runs = 0.0; - if quick_pen && !turn.muted && !over_bar && ctrl_alone(mods, crate::keymap::platform()) { - turn.taken = true; - runs = steps(&w, line, &mut turn.rest); - } - if (first || turn != before) - && let Some(ctx) = &app.ui_ctx - { - ctx.data_mut(|d| d.insert_temp(id, turn)); + if quick_pen && !muted && !over_bar && ctrl_alone(mods, crate::keymap::platform()) { + let mut rest = w.claimed_spent.x; + let made = steps(&w, line, &mut rest); + // A share of a gesture another scroller owns cannot be claimed; the tool still takes it, as the + // canvas's output keeps the view for this pass. + space.claim_wheel(ctx, egui::vec2(rest - w.claimed_spent.x, 0.0)); + taken = true; + runs = made; } let cmd = if runs > 0.0 { "tool.quickPen.arcLarger" } else { "tool.quickPen.arcSmaller" }; for _ in 0..(runs.abs() as u32) { @@ -139,5 +134,5 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, wheel: Option, bar: Opti } } } - quick_pen && turn.taken + quick_pen && taken } From f4888892d02d7e7202f7ce162c3c7014957d8163 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 22:36:16 -0800 Subject: [PATCH 06/11] Quick Pen: the first Ctrl+wheel share keeps the view; English-only labels The arc-size wheel is now read before the canvas body, so on the first share of a turn the controls, painting and tool host use the view the pass began with instead of the zoomed one. The framework reports a frame's wheel motion as signed totals, so opposite notches in one frame cancel; the docs say so. The arc size labels are English only, as new strings go through craft-i18n. --- crates/ui-egui/src/canvas.rs | 43 ++++++++++++++++--- crates/ui-egui/src/canvas/quick_pen_wheel.rs | 14 ++++-- crates/ui-egui/src/i18n/bg.tsv | 2 - crates/ui-egui/src/i18n/bs.tsv | 2 - crates/ui-egui/src/i18n/ca.tsv | 2 - crates/ui-egui/src/i18n/cs.tsv | 2 - crates/ui-egui/src/i18n/da.tsv | 2 - crates/ui-egui/src/i18n/de.tsv | 2 - crates/ui-egui/src/i18n/el.tsv | 2 - crates/ui-egui/src/i18n/es.tsv | 2 - crates/ui-egui/src/i18n/fi.tsv | 2 - crates/ui-egui/src/i18n/fr.tsv | 2 - crates/ui-egui/src/i18n/gu.tsv | 2 - crates/ui-egui/src/i18n/hi.tsv | 2 - crates/ui-egui/src/i18n/hu.tsv | 2 - crates/ui-egui/src/i18n/id.tsv | 2 - crates/ui-egui/src/i18n/it.tsv | 2 - crates/ui-egui/src/i18n/ja.tsv | 2 - crates/ui-egui/src/i18n/ka.tsv | 2 - crates/ui-egui/src/i18n/ko.tsv | 2 - crates/ui-egui/src/i18n/nl.tsv | 2 - crates/ui-egui/src/i18n/pl.tsv | 2 - crates/ui-egui/src/i18n/pt-br.tsv | 2 - crates/ui-egui/src/i18n/ru.tsv | 2 - crates/ui-egui/src/i18n/sv.tsv | 2 - crates/ui-egui/src/i18n/tr.tsv | 2 - crates/ui-egui/src/i18n/uk.tsv | 2 - crates/ui-egui/src/i18n/vi.tsv | 2 - crates/ui-egui/src/i18n/zh-hans.tsv | 2 - crates/ui-egui/src/i18n/zh-hant.tsv | 2 - crates/ui-egui/src/tests/quickpenwheel.rs | 45 ++++++++++++++++++++ docs/mcp.md | 11 +++-- 32 files changed, 99 insertions(+), 70 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index 34b6d7e5df..f6ac38176b 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -6,7 +6,7 @@ use craft::behavior::{CanvasView, PressPhase}; use craft::keymap::Mods; use craft::ui::canvas::{ Canvas, CanvasScrollbars, CanvasSpace, ContextSource, RotateView, ToolHostResponse, ToolPass, ViewCommands, ViewRequest, ViewTarget, - canvas_space, tool_pass, + canvas_space, tool_pass, with_canvas_space, }; use craft::ui::contract::{Bind, Props as _, Show as _, ShowContainer as _}; use craft::ui::primitives::PaintSlot; @@ -232,8 +232,31 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin }; let mut body = Body::default(); let shown = canvas.show(ui, |ui, env| { - if let Some(space) = canvas_space(&env.env) { - body = show_body(app, ui, &space, tool_pass(&env.env).as_ref(), win, kind); + if let Some(mut space) = canvas_space(&env.env) { + let mut pass = tool_pass(&env.env); + let bar_paint = PaintSlot::reserve(ui.painter()); + let arc_turn = if kind == BodyKind::Live && app.ui.screen_mode < 3 { + let mut bar_space = space; + if space.wheel().is_some_and(|w| w.claimed || quick_pen_wheel::control_turn(app, &w)) { + bar_space.set_view(given); + } + let bar = quick_pen_bar::quick_pen_bar(app, ui, &bar_space); + quick_pen_wheel::arc_size(app, ui.ctx(), &space, bar) + } else { + false + }; + let bar_shapes = bar_paint.take_after(ui.ctx()); + // The framework settles wheel navigation before the body. A claimed share uses the + // saved view for the controls, painting and tool host, including its first pass. + if arc_turn { + space.set_view(given); + if let Some(pass) = pass.as_mut() { + pass.space = Some(space); + pass.view = Some(given); + } + } + body = with_canvas_space(ui, space, |ui| show_body(app, ui, &space, pass.as_ref(), win, kind, bar_shapes)); + body.arc_turn = arc_turn; } }); let output = shown.output; @@ -289,7 +312,15 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin /// The body of the canvas in order: controls that take presses first, the tool host, the selection's marks, the /// picture last. -fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: Option<&ToolPass>, win: Win, kind: BodyKind) -> Body { +fn show_body( + app: &mut VectorcraftApp, + ui: &mut Ui, + space: &CanvasSpace, + pass: Option<&ToolPass>, + win: Win, + kind: BodyKind, + bar_shapes: Vec, +) -> Body { let live = kind == BodyKind::Live; let presenting = app.ui.screen_mode == 3; let background = space.background(); @@ -327,9 +358,7 @@ fn show_body(app: &mut VectorcraftApp, ui: &mut Ui, space: &CanvasSpace, pass: O // The bars give way to a drag, not to a click. let dragging = in_gesture(app, ui.ctx()) && ui.input(|i| i.pointer.is_decidedly_dragging()); let task_bar = (app.ui.task_bar && !revolve_editing(app) && !strip && !dragging).then(|| task_bar::task_bar(app, ui, space)).flatten(); - let bar = quick_pen_bar::quick_pen_bar(app, ui, space); - // A Ctrl-wheel turn with the Quick Pen tool changes its arc size; the view stays as it was before the pass. - out.arc_turn = quick_pen_wheel::arc_size(app, ui.ctx(), space, bar); + PaintSlot::reserve(ui.painter()).extend(ui.ctx(), bar_shapes); contour_bar::contour_bar(app, ui, space); // After the task bar, which the row of character alternates keeps clear of. alternates_bar::alternates_bar(app, ui, space, task_bar); diff --git a/crates/ui-egui/src/canvas/quick_pen_wheel.rs b/crates/ui-egui/src/canvas/quick_pen_wheel.rs index b66ad3963e..f914413a95 100644 --- a/crates/ui-egui/src/canvas/quick_pen_wheel.rs +++ b/crates/ui-egui/src/canvas/quick_pen_wheel.rs @@ -4,7 +4,7 @@ //! and on macOS alike //! ([Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html)). //! VectorCraft's own rules: a mouse wheel turned with Ctrl does the same; a mouse wheel makes one -//! step of 15°, as `[` and `]` do, for each notch (each whole wheel line, at least one for each share +//! step of 15°, as `[` and `]` do, for each net whole wheel line (at least one for each nonzero share //! of wheel motion the canvas reads), and a touchpad makes one step for each wheel line of its //! gesture's motion; up makes the arc larger and down smaller, and sideways motion makes no step //! (with Ctrl on Windows and Linux, where the wheel reaches the canvas as a zoom, sideways motion @@ -39,6 +39,9 @@ fn ctrl_alone(m: Mods, os: Platform) -> bool { /// lines in `zoom_lines`; sideways motion there adds to up and down, as egui's zoom factor does. /// Points of a touchpad or a browser are lines of `line` points. fn lines(wheel: &Wheel, line: f32) -> f32 { + // Wheel exposes only the share's signed totals, without individual events or separate up/down + // counts. Opposite notches in one pass cancel; their order and steps at the arc limits cannot + // be recovered. Count the net lines the framework reports. let d = if wheel.zoom_lines != egui::Vec2::ZERO { wheel.zoom_lines.x + wheel.zoom_lines.y } else if wheel.scroll.y != 0.0 { @@ -63,6 +66,12 @@ fn fine(wheel: &Wheel, lines: f32) -> bool { } } +pub(super) fn control_turn(app: &VectorcraftApp, wheel: &Wheel) -> bool { + let line = crate::app::view::navigation(&app.session.prefs).wheel_line.max(1.0); + let mods = if fine(wheel, lines(wheel, line)) { wheel.held } else { wheel.mods }; + ctrl_alone(mods, crate::keymap::platform()) +} + /// Whole lines in `v`, toward zero, with [`LINE_SLACK`] for rounding. fn whole(v: f32) -> f32 { (v + LINE_SLACK * v.signum()).trunc() @@ -109,12 +118,11 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, ctx: &egui::Context, space: &Ca } let muted = w.modal || app_modal; let line = crate::app::view::navigation(&app.session.prefs).wheel_line.max(1.0); - let mods = if fine(&w, lines(&w, line)) { w.held } else { w.mods }; let over_bar = w.at.zip(bar).is_some_and(|(at, bar)| bar.contains(at)); let quick_pen = app.session.tool_id() == vectorcraft_tools::quickpen::ID; let mut taken = w.claimed; let mut runs = 0.0; - if quick_pen && !muted && !over_bar && ctrl_alone(mods, crate::keymap::platform()) { + if quick_pen && !muted && !over_bar && control_turn(app, &w) { let mut rest = w.claimed_spent.x; let made = steps(&w, line, &mut rest); // A share of a gesture another scroller owns cannot be claimed; the tool still takes it, as the diff --git a/crates/ui-egui/src/i18n/bg.tsv b/crates/ui-egui/src/i18n/bg.tsv index 66ae31f690..b7ad3eb99b 100644 --- a/crates/ui-egui/src/i18n/bg.tsv +++ b/crates/ui-egui/src/i18n/bg.tsv @@ -2885,8 +2885,6 @@ font-technology Variable Променливи Continuous Arc Непрекъсната дъга Sharp Corner Arc Дъга с остър ъгъл Flip Arc Обръщане на дъгата - Increase Arc Size Увеличаване на размера на дъгата - Decrease Arc Size Намаляване на размера на дъгата Hide Toolbar Скриване на лентата с инструменти Pin Toolbar Position Закачане на позицията на лентата с инструменти Reset Toolbar Position Нулиране на позицията на лентата с инструменти diff --git a/crates/ui-egui/src/i18n/bs.tsv b/crates/ui-egui/src/i18n/bs.tsv index 10fb6d4b59..b125e378f5 100644 --- a/crates/ui-egui/src/i18n/bs.tsv +++ b/crates/ui-egui/src/i18n/bs.tsv @@ -4254,8 +4254,6 @@ theme Appearance Izgled Continuous Arc Neprekidni luk Sharp Corner Arc Luk s oštrim uglom Flip Arc Preokreni luk - Increase Arc Size Povećaj veličinu luka - Decrease Arc Size Smanji veličinu luka Hide Toolbar Sakrij traku s alatima Pin Toolbar Position Prikvači položaj trake s alatima Reset Toolbar Position Vrati položaj trake s alatima na početno diff --git a/crates/ui-egui/src/i18n/ca.tsv b/crates/ui-egui/src/i18n/ca.tsv index 4416321fa2..555080655a 100644 --- a/crates/ui-egui/src/i18n/ca.tsv +++ b/crates/ui-egui/src/i18n/ca.tsv @@ -3500,8 +3500,6 @@ digits Malayalam Malaiàlam Continuous Arc Arc continu Sharp Corner Arc Arc de cantonada aguda Flip Arc Inverteix l’arc - Increase Arc Size Augmenta la mida de l’arc - Decrease Arc Size Redueix la mida de l’arc Hide Toolbar Amaga la barra d’eines Pin Toolbar Position Fixa la posició de la barra d’eines Reset Toolbar Position Restableix la posició de la barra d’eines diff --git a/crates/ui-egui/src/i18n/cs.tsv b/crates/ui-egui/src/i18n/cs.tsv index 9dabe178f2..8d11266cdd 100644 --- a/crates/ui-egui/src/i18n/cs.tsv +++ b/crates/ui-egui/src/i18n/cs.tsv @@ -4361,8 +4361,6 @@ theme Appearance Motiv Continuous Arc Plynulý oblouk Sharp Corner Arc Oblouk s ostrým rohem Flip Arc Překlopit oblouk - Increase Arc Size Zvětšit velikost oblouku - Decrease Arc Size Zmenšit velikost oblouku Hide Toolbar Skrýt panel nástrojů Pin Toolbar Position Připnout polohu panelu nástrojů Reset Toolbar Position Obnovit polohu panelu nástrojů diff --git a/crates/ui-egui/src/i18n/da.tsv b/crates/ui-egui/src/i18n/da.tsv index 22cfe3a223..9820804ff0 100644 --- a/crates/ui-egui/src/i18n/da.tsv +++ b/crates/ui-egui/src/i18n/da.tsv @@ -6932,8 +6932,6 @@ theme Appearance Udseende Continuous Arc Fortløbende bue Sharp Corner Arc Bue med skarpt hjørne Flip Arc Vend bue - Increase Arc Size Øg buestørrelse - Decrease Arc Size Formindsk buestørrelse Hide Toolbar Skjul værktøjslinjen Pin Toolbar Position Fastgør værktøjslinjens placering Reset Toolbar Position Nulstil værktøjslinjens placering diff --git a/crates/ui-egui/src/i18n/de.tsv b/crates/ui-egui/src/i18n/de.tsv index 01a2aa40ef..d29f3c46c0 100644 --- a/crates/ui-egui/src/i18n/de.tsv +++ b/crates/ui-egui/src/i18n/de.tsv @@ -2809,8 +2809,6 @@ file-filter Templates Vorlagen Continuous Arc Fortlaufender Bogen Sharp Corner Arc Bogen mit scharfer Ecke Flip Arc Bogen spiegeln - Increase Arc Size Bogengröße erhöhen - Decrease Arc Size Bogengröße verringern Hide Toolbar Werkzeugleiste ausblenden Pin Toolbar Position Position der Werkzeugleiste fixieren Reset Toolbar Position Position der Werkzeugleiste zurücksetzen diff --git a/crates/ui-egui/src/i18n/el.tsv b/crates/ui-egui/src/i18n/el.tsv index 87911e63b0..e4a651342a 100644 --- a/crates/ui-egui/src/i18n/el.tsv +++ b/crates/ui-egui/src/i18n/el.tsv @@ -2208,8 +2208,6 @@ font-technology Variable Μεταβλητές Continuous Arc Συνεχές τόξο Sharp Corner Arc Τόξο με αιχμηρή γωνία Flip Arc Αναστροφή τόξου - Increase Arc Size Αύξηση μεγέθους τόξου - Decrease Arc Size Μείωση μεγέθους τόξου Hide Toolbar Απόκρυψη γραμμής εργαλείων Pin Toolbar Position Σταθεροποίηση θέσης γραμμής εργαλείων Reset Toolbar Position Επαναφορά θέσης γραμμής εργαλείων diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsv index fb8b534363..008a0b6483 100644 --- a/crates/ui-egui/src/i18n/es.tsv +++ b/crates/ui-egui/src/i18n/es.tsv @@ -2847,8 +2847,6 @@ font-technology Variable Variables Continuous Arc Arco continuo Sharp Corner Arc Arco de esquina aguda Flip Arc Voltear arco - Increase Arc Size Aumentar tamaño del arco - Decrease Arc Size Reducir tamaño del arco Hide Toolbar Ocultar barra de herramientas Pin Toolbar Position Fijar posición de la barra de herramientas Reset Toolbar Position Restablecer posición de la barra de herramientas diff --git a/crates/ui-egui/src/i18n/fi.tsv b/crates/ui-egui/src/i18n/fi.tsv index b53af1e432..ffbeb6f49b 100644 --- a/crates/ui-egui/src/i18n/fi.tsv +++ b/crates/ui-egui/src/i18n/fi.tsv @@ -4278,8 +4278,6 @@ theme Appearance Ulkoasu Continuous Arc Jatkuva kaari Sharp Corner Arc Terävän kulman kaari Flip Arc Käännä kaari - Increase Arc Size Suurenna kaaren kokoa - Decrease Arc Size Pienennä kaaren kokoa Hide Toolbar Piilota työkalurivi Pin Toolbar Position Kiinnitä työkalurivin sijainti Reset Toolbar Position Palauta työkalurivin sijainti diff --git a/crates/ui-egui/src/i18n/fr.tsv b/crates/ui-egui/src/i18n/fr.tsv index 597f36670e..7e03e3b7c4 100644 --- a/crates/ui-egui/src/i18n/fr.tsv +++ b/crates/ui-egui/src/i18n/fr.tsv @@ -2835,8 +2835,6 @@ font-technology Variable Variables Continuous Arc Arc continu Sharp Corner Arc Arc à angle vif Flip Arc Retourner l’arc - Increase Arc Size Augmenter la taille de l’arc - Decrease Arc Size Réduire la taille de l’arc Hide Toolbar Masquer la barre d’outils Pin Toolbar Position Épingler la position de la barre d’outils Reset Toolbar Position Réinitialiser la position de la barre d’outils diff --git a/crates/ui-egui/src/i18n/gu.tsv b/crates/ui-egui/src/i18n/gu.tsv index 981232e347..497ef4d6d8 100644 --- a/crates/ui-egui/src/i18n/gu.tsv +++ b/crates/ui-egui/src/i18n/gu.tsv @@ -2849,8 +2849,6 @@ Continuous Arc સતત આર્ક Sharp Corner Arc તીક્ષ્ણ ખૂણાવાળો આર્ક Flip Arc આર્ક ફ્લિપ કરો - Increase Arc Size આર્કનું કદ વધારો - Decrease Arc Size આર્કનું કદ ઘટાડો Hide Toolbar ટૂલબાર છુપાવો Pin Toolbar Position ટૂલબાર સ્થિતિ પિન કરો Reset Toolbar Position ટૂલબાર સ્થિતિ રીસેટ કરો diff --git a/crates/ui-egui/src/i18n/hi.tsv b/crates/ui-egui/src/i18n/hi.tsv index 0be240457b..8ad28968c5 100644 --- a/crates/ui-egui/src/i18n/hi.tsv +++ b/crates/ui-egui/src/i18n/hi.tsv @@ -4047,8 +4047,6 @@ arrowhead Feather पंख Continuous Arc सतत आर्क Sharp Corner Arc तीखे कोने वाला आर्क Flip Arc आर्क पलटें - Increase Arc Size आर्क का आकार बढ़ाएँ - Decrease Arc Size आर्क का आकार घटाएँ Hide Toolbar टूलबार छिपाएँ Pin Toolbar Position टूलबार स्थिति पिन करें Reset Toolbar Position टूलबार स्थिति रीसेट करें diff --git a/crates/ui-egui/src/i18n/hu.tsv b/crates/ui-egui/src/i18n/hu.tsv index d9d282b649..3116815efa 100644 --- a/crates/ui-egui/src/i18n/hu.tsv +++ b/crates/ui-egui/src/i18n/hu.tsv @@ -3379,8 +3379,6 @@ file-filter Templates Sablonok Continuous Arc Folytonos ív Sharp Corner Arc Éles sarkú ív Flip Arc Ív tükrözése - Increase Arc Size Ívméret növelése - Decrease Arc Size Ívméret csökkentése Hide Toolbar Eszköztár elrejtése Pin Toolbar Position Eszköztár helyének rögzítése Reset Toolbar Position Eszköztár helyének visszaállítása diff --git a/crates/ui-egui/src/i18n/id.tsv b/crates/ui-egui/src/i18n/id.tsv index e7c8d8be4a..b159d2bfb7 100644 --- a/crates/ui-egui/src/i18n/id.tsv +++ b/crates/ui-egui/src/i18n/id.tsv @@ -4797,8 +4797,6 @@ theme Appearance Tampilan Continuous Arc Busur bersambung Sharp Corner Arc Busur sudut tajam Flip Arc Balik busur - Increase Arc Size Perbesar ukuran busur - Decrease Arc Size Perkecil ukuran busur Hide Toolbar Sembunyikan bilah alat Pin Toolbar Position Sematkan posisi bilah alat Reset Toolbar Position Atur ulang posisi bilah alat diff --git a/crates/ui-egui/src/i18n/it.tsv b/crates/ui-egui/src/i18n/it.tsv index 57601c82df..d6b341a367 100644 --- a/crates/ui-egui/src/i18n/it.tsv +++ b/crates/ui-egui/src/i18n/it.tsv @@ -2894,8 +2894,6 @@ file-filter Templates Modelli Continuous Arc Arco continuo Sharp Corner Arc Arco ad angolo vivo Flip Arc Capovolgi arco - Increase Arc Size Aumenta dimensione arco - Decrease Arc Size Riduci dimensione arco Hide Toolbar Nascondi barra degli strumenti Pin Toolbar Position Fissa posizione barra degli strumenti Reset Toolbar Position Ripristina posizione barra degli strumenti diff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsv index 681efb5f1b..48f6dd36cf 100644 --- a/crates/ui-egui/src/i18n/ja.tsv +++ b/crates/ui-egui/src/i18n/ja.tsv @@ -2972,8 +2972,6 @@ antiAlias Sharp シャープ Continuous Arc 連続円弧 Sharp Corner Arc 鋭角円弧 Flip Arc 円弧を反転 - Increase Arc Size 円弧のサイズを大きく - Decrease Arc Size 円弧のサイズを小さく Hide Toolbar ツールバーを隠す Pin Toolbar Position ツールバーの位置を固定 Reset Toolbar Position ツールバーの位置をリセット diff --git a/crates/ui-egui/src/i18n/ka.tsv b/crates/ui-egui/src/i18n/ka.tsv index 646108c76d..cbb58ee5ab 100644 --- a/crates/ui-egui/src/i18n/ka.tsv +++ b/crates/ui-egui/src/i18n/ka.tsv @@ -6101,8 +6101,6 @@ theme Appearance იერსახე Continuous Arc უწყვეტი რკალი Sharp Corner Arc მახვილკუთხიანი რკალი Flip Arc რკალის არეკვლა - Increase Arc Size რკალის ზომის გაზრდა - Decrease Arc Size რკალის ზომის შემცირება Hide Toolbar ხელსაწყოთა ზოლის დამალვა Pin Toolbar Position ხელსაწყოთა ზოლის პოზიციის ჩამაგრება Reset Toolbar Position ხელსაწყოთა ზოლის პოზიციის ჩამოყრა diff --git a/crates/ui-egui/src/i18n/ko.tsv b/crates/ui-egui/src/i18n/ko.tsv index 4dffe2d723..bd430d2fc1 100644 --- a/crates/ui-egui/src/i18n/ko.tsv +++ b/crates/ui-egui/src/i18n/ko.tsv @@ -2962,8 +2962,6 @@ antiAlias Sharp 날카롭게 Continuous Arc 연속 호 Sharp Corner Arc 뾰족한 모서리 호 Flip Arc 호 뒤집기 - Increase Arc Size 호 크기 늘리기 - Decrease Arc Size 호 크기 줄이기 Hide Toolbar 도구 모음 숨기기 Pin Toolbar Position 도구 모음 위치 고정 Reset Toolbar Position 도구 모음 위치 재설정 diff --git a/crates/ui-egui/src/i18n/nl.tsv b/crates/ui-egui/src/i18n/nl.tsv index 06535d7ea7..20365f1488 100644 --- a/crates/ui-egui/src/i18n/nl.tsv +++ b/crates/ui-egui/src/i18n/nl.tsv @@ -4793,8 +4793,6 @@ theme Appearance Vormgeving Continuous Arc Doorlopende boog Sharp Corner Arc Boog met scherpe hoek Flip Arc Boog spiegelen - Increase Arc Size Boog groter maken - Decrease Arc Size Boog kleiner maken Hide Toolbar Werkbalk verbergen Pin Toolbar Position Werkbalkpositie vastzetten Reset Toolbar Position Werkbalkpositie herstellen diff --git a/crates/ui-egui/src/i18n/pl.tsv b/crates/ui-egui/src/i18n/pl.tsv index fc2e60066f..4a22a1dd93 100644 --- a/crates/ui-egui/src/i18n/pl.tsv +++ b/crates/ui-egui/src/i18n/pl.tsv @@ -4224,8 +4224,6 @@ theme Appearance Wygląd Continuous Arc Łuk ciągły Sharp Corner Arc Łuk z ostrym narożnikiem Flip Arc Odwróć łuk - Increase Arc Size Zwiększ rozmiar łuku - Decrease Arc Size Zmniejsz rozmiar łuku Hide Toolbar Ukryj pasek narzędzi Pin Toolbar Position Przypnij położenie paska narzędzi Reset Toolbar Position Resetuj położenie paska narzędzi diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsv index 7ccf71dad0..6d910ce85f 100644 --- a/crates/ui-egui/src/i18n/pt-br.tsv +++ b/crates/ui-egui/src/i18n/pt-br.tsv @@ -2337,8 +2337,6 @@ antiAlias Sharp Nítido Continuous Arc Arco Contínuo Sharp Corner Arc Arco de Canto Agudo Flip Arc Virar Arco - Increase Arc Size Aumentar Tamanho do Arco - Decrease Arc Size Diminuir Tamanho do Arco Hide Toolbar Ocultar Barra de Ferramentas Pin Toolbar Position Fixar Posição da Barra de Ferramentas Reset Toolbar Position Redefinir Posição da Barra de Ferramentas diff --git a/crates/ui-egui/src/i18n/ru.tsv b/crates/ui-egui/src/i18n/ru.tsv index 1d662a491c..60906af64a 100644 --- a/crates/ui-egui/src/i18n/ru.tsv +++ b/crates/ui-egui/src/i18n/ru.tsv @@ -2876,8 +2876,6 @@ file-filter Templates Шаблоны Continuous Arc Непрерывная дуга Sharp Corner Arc Дуга с острым углом Flip Arc Отразить дугу - Increase Arc Size Увеличить размер дуги - Decrease Arc Size Уменьшить размер дуги Hide Toolbar Скрыть панель инструментов Pin Toolbar Position Закрепить положение панели инструментов Reset Toolbar Position Сбросить положение панели инструментов diff --git a/crates/ui-egui/src/i18n/sv.tsv b/crates/ui-egui/src/i18n/sv.tsv index 0c739b14d6..bf7420d255 100644 --- a/crates/ui-egui/src/i18n/sv.tsv +++ b/crates/ui-egui/src/i18n/sv.tsv @@ -2768,8 +2768,6 @@ font-technology Variable Variabla Continuous Arc Kontinuerlig båge Sharp Corner Arc Båge med skarpt hörn Flip Arc Vänd båge - Increase Arc Size Öka bågstorlek - Decrease Arc Size Minska bågstorlek Hide Toolbar Dölj verktygsfältet Pin Toolbar Position Fäst verktygsfältets position Reset Toolbar Position Återställ verktygsfältets position diff --git a/crates/ui-egui/src/i18n/tr.tsv b/crates/ui-egui/src/i18n/tr.tsv index ad7f1cc97f..830b60e56b 100644 --- a/crates/ui-egui/src/i18n/tr.tsv +++ b/crates/ui-egui/src/i18n/tr.tsv @@ -2611,8 +2611,6 @@ shape Open Açık Continuous Arc Sürekli Yay Sharp Corner Arc Keskin Köşeli Yay Flip Arc Yayı Çevir - Increase Arc Size Yay Boyutunu Artır - Decrease Arc Size Yay Boyutunu Azalt Hide Toolbar Araç Çubuğunu Gizle Pin Toolbar Position Araç Çubuğu Konumunu Sabitle Reset Toolbar Position Araç Çubuğu Konumunu Sıfırla diff --git a/crates/ui-egui/src/i18n/uk.tsv b/crates/ui-egui/src/i18n/uk.tsv index d898b8991b..09a9e4bf6d 100644 --- a/crates/ui-egui/src/i18n/uk.tsv +++ b/crates/ui-egui/src/i18n/uk.tsv @@ -2886,8 +2886,6 @@ file-filter Templates Шаблони Continuous Arc Неперервна дуга Sharp Corner Arc Дуга з гострим кутом Flip Arc Відобразити дугу - Increase Arc Size Збільшити розмір дуги - Decrease Arc Size Зменшити розмір дуги Hide Toolbar Сховати панель інструментів Pin Toolbar Position Закріпити положення панелі інструментів Reset Toolbar Position Скинути положення панелі інструментів diff --git a/crates/ui-egui/src/i18n/vi.tsv b/crates/ui-egui/src/i18n/vi.tsv index a04c6480be..bc63725d0f 100644 --- a/crates/ui-egui/src/i18n/vi.tsv +++ b/crates/ui-egui/src/i18n/vi.tsv @@ -3199,8 +3199,6 @@ digits Hindi Hindi Continuous Arc Cung liên tục Sharp Corner Arc Cung góc nhọn Flip Arc Lật cung - Increase Arc Size Tăng kích thước cung - Decrease Arc Size Giảm kích thước cung Hide Toolbar Ẩn thanh công cụ Pin Toolbar Position Ghim vị trí thanh công cụ Reset Toolbar Position Đặt lại vị trí thanh công cụ diff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsv index c69caa23bf..9b7e1c7bbc 100644 --- a/crates/ui-egui/src/i18n/zh-hans.tsv +++ b/crates/ui-egui/src/i18n/zh-hans.tsv @@ -2737,8 +2737,6 @@ file-filter Templates 模板 Continuous Arc 连续弧线 Sharp Corner Arc 尖角弧线 Flip Arc 翻转弧线 - Increase Arc Size 增大弧线尺寸 - Decrease Arc Size 减小弧线尺寸 Hide Toolbar 隐藏工具栏 Pin Toolbar Position 固定工具栏位置 Reset Toolbar Position 重置工具栏位置 diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsv index 99cdf242e6..2e3bae2d60 100644 --- a/crates/ui-egui/src/i18n/zh-hant.tsv +++ b/crates/ui-egui/src/i18n/zh-hant.tsv @@ -4197,8 +4197,6 @@ liquify-list-end {0}, {1} {0}和{1} Continuous Arc 連續弧線 Sharp Corner Arc 尖角弧線 Flip Arc 翻轉弧線 - Increase Arc Size 增大弧線尺寸 - Decrease Arc Size 減小弧線尺寸 Hide Toolbar 隱藏工具列 Pin Toolbar Position 釘選工具列位置 Reset Toolbar Position 重設工具列位置 diff --git a/crates/ui-egui/src/tests/quickpenwheel.rs b/crates/ui-egui/src/tests/quickpenwheel.rs index 369e27847d..dba5367ebe 100644 --- a/crates/ui-egui/src/tests/quickpenwheel.rs +++ b/crates/ui-egui/src/tests/quickpenwheel.rs @@ -134,6 +134,51 @@ fn ctrl_wheel_changes_the_arc_size_and_not_the_view() { }); } +/// The first claimed share keeps both the stored view and the tool host's document point. +#[test] +fn the_first_ctrl_wheel_frame_keeps_the_view_and_pointer() { + let mut app = app(); + on_canvas(&mut app, |rig| { + rig.fx.settle(); + let at = center(rig) + vec2(80.0, 40.0); + rig.fx.frame(vec![Event::PointerMoved(at)]); + let still = view(rig); + let point = rig.app().hover_doc.expect("the pointer is over the canvas"); + let win = crate::doc_windows::current(&rig.app()).unwrap(); + let id = crate::canvas::canvas_id(win); + let shown = craft::ui::canvas::ToolHost::shown_space(rig.fx.ctx(), id).unwrap().view; + rig.fx.frame(vec![notch(1.0, ctrl())]); + assert_eq!(arc_size(rig), 195.0); + assert_eq!(view(rig).zoom, still.zoom, "the first share keeps the zoom"); + assert_eq!(view(rig).center, still.center, "the first share keeps the pan"); + assert_eq!(craft::ui::canvas::ToolHost::shown_space(rig.fx.ctx(), id).unwrap().view, shown, "the tool host sees the saved view"); + assert_eq!(rig.app().hover_doc, Some(point), "the tool host uses the saved view in the same frame"); + }); +} + +/// Opposite notches in one frame use the framework's net lines and keep the tool host's view. +#[test] +fn opposite_notches_use_the_frameworks_reported_net_motion() { + let mut app = app(); + on_canvas(&mut app, |rig| { + rig.fx.settle(); + rig.fx.frame(vec![Event::PointerMoved(center(rig) + vec2(80.0, 40.0))]); + let win = crate::doc_windows::current(&rig.app()).unwrap(); + let id = crate::canvas::canvas_id(win); + let shown = craft::ui::canvas::ToolHost::shown_space(rig.fx.ctx(), id).unwrap().view; + for (start, notches, expected) in + [(345, vec![1.0, -1.0], 345.0), (345, vec![1.0, 1.0, -1.0], 345.0), (180, vec![1.0, -1.0], 180.0), (180, vec![1.0, 1.0, -1.0], 195.0)] + { + rig.app().run("tool.setOption", json!({"key": "turn", "value": start})).unwrap(); + rig.fx.frame(notches.into_iter().map(|dy| notch(dy, ctrl())).collect()); + assert_eq!(arc_size(rig), expected, "the framework reports net lines, including at the arc limit"); + assert_eq!(craft::ui::canvas::ToolHost::shown_space(rig.fx.ctx(), id).unwrap().view, shown, "mixed notches keep the tool host's view"); + rig.fx.advance(1.5); + rig.fx.frame(vec![]); + } + }); +} + /// A touchpad steps once per wheel line of motion: half a line makes no step, the second half of the /// same gesture makes one, and momentum after it makes none (egui reports momentum on macOS). Half a /// line in a later turn does not add to the half before it. diff --git a/docs/mcp.md b/docs/mcp.md index 161289dff3..7cf9cd99f6 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -8841,9 +8841,12 @@ tool edit, then returns false, changing nothing more, when the Quick Pen tool is scroll on a touchpad over the canvas (the Control key on macOS too) changes the arc size as well, as [Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html) lists: the touchpad makes one step for each wheel line of its motion, and motion that goes on after the fingers lift -makes none. A mouse wheel turned with Ctrl over the canvas does the same, one step for each wheel event (one per -notch). Up makes the arc size larger and down smaller, sideways motion makes no step, and the view does not zoom or -scroll for the rest of that wheel turn. During a drag, C, `[` `]` and the wheel change the sharp-corner arc being +makes none. A mouse wheel turned with Ctrl over the canvas does the same, one step for each net whole wheel line +reported by the canvas framework, with at least one step for a nonzero share. The framework sums events within a +frame, so opposite notches cancel and their order is unavailable. Up makes the arc size larger and down smaller. +Sideways motion makes no step, except when Ctrl on Windows or Linux makes the framework report it as zoom motion. +The view does not zoom or scroll for the rest of that wheel turn. During a drag, +C, `[` `]` and the wheel change the sharp-corner arc being dragged, and Alt switches its action. A dragged piece ends where the press is let go. A click on the first point closes the path, and a click on an end of an open path goes on drawing from that end. Escape or Enter ends the path, and so does an edit made to it by another command. An edit made by another command during a drag, to the path or to other art, also ends the path: the edit @@ -8852,7 +8855,7 @@ command edits the document adds no piece, and the edit stays. The path's points preview shows the piece the next click adds. Points snap to Smart Guides. Each piece is one undo step, together with the flips and size changes made during its drag, and each flip or size change made between presses is one undo step. The arc size of 180°, its 15° steps, the side an arc bulges to, what C, `[` `]` and the wheel do during a drag, Enter -ending the path, the mouse wheel changing the arc size, and the wheel's step per event or wheel line and its direction are +ending the path, the mouse wheel changing the arc size, and the wheel's step per net wheel line and its direction are VectorCraft's own rules. The tool keeps `action` and `turn` with the preferences (`tool.setOption {tool: "quickPen", key, value}`). From 9a843a5f0ef8d05ea4dc3b6159922712b6675dde Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Sun, 29 Nov 2026 22:58:22 -0800 Subject: [PATCH 07/11] Quick Pen: the arc-size wheel keeps other view changes and pinches A Ctrl+wheel share the tool takes now restores only the zoom, pan and rotation from before the wheel, so the content rect beside the rulers stays as the canvas settled it and a view command queued in the same frame still applies. A share outside the content rect makes no step, a native pinch with Control held zooms as usual, and the toolbar is shown in the restored space. The parity entry says one step per net whole wheel line. --- crates/ui-egui/src/canvas.rs | 30 +++++--- crates/ui-egui/src/canvas/quick_pen_wheel.rs | 7 +- crates/ui-egui/src/tests/quickpenwheel.rs | 75 ++++++++++++++++++++ docs/target-app-parity.md | 2 +- 4 files changed, 100 insertions(+), 14 deletions(-) diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index f6ac38176b..85ad06e131 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -145,7 +145,7 @@ struct Body { /// A view a compass or scroll bar edit made this pass. edited: Option, /// The Quick Pen tool took this pass's wheel for its arc size ([`quick_pen_wheel::arc_size`]). - arc_turn: bool, + arc_view: Option, } /// Window `win`'s document in the framework canvas, filling the rest of `ui`. True when the canvas @@ -211,6 +211,7 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin // cursors the tools are told about. let precise = app.precise_cursors() != host_caps_lock; let prefs = &app.session.prefs; + let before_wheel = cv; let mut canvas = Canvas::new("Document") .id(canvas_id(win)) .view(Bind::bound(&mut cv)) @@ -235,12 +236,21 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin if let Some(mut space) = canvas_space(&env.env) { let mut pass = tool_pass(&env.env); let bar_paint = PaintSlot::reserve(ui.painter()); + let mut arc_view = space.target(); + if space.wheel().is_some_and(|w| !w.claimed && quick_pen_wheel::control_turn(app, &w)) { + arc_view.zoom = before_wheel.zoom; + arc_view.center = before_wheel.center; + arc_view.rotation = before_wheel.rotation; + for request in &queued { + request.command().apply(&mut arc_view, &target, Some(&layers), ppp, &scheme); + } + } let arc_turn = if kind == BodyKind::Live && app.ui.screen_mode < 3 { let mut bar_space = space; if space.wheel().is_some_and(|w| w.claimed || quick_pen_wheel::control_turn(app, &w)) { - bar_space.set_view(given); + bar_space.set_view(arc_view); } - let bar = quick_pen_bar::quick_pen_bar(app, ui, &bar_space); + let bar = with_canvas_space(ui, bar_space, |ui| quick_pen_bar::quick_pen_bar(app, ui, &bar_space)); quick_pen_wheel::arc_size(app, ui.ctx(), &space, bar) } else { false @@ -249,14 +259,14 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin // The framework settles wheel navigation before the body. A claimed share uses the // saved view for the controls, painting and tool host, including its first pass. if arc_turn { - space.set_view(given); + space.set_view(arc_view); if let Some(pass) = pass.as_mut() { pass.space = Some(space); - pass.view = Some(given); + pass.view = Some(arc_view); } } body = with_canvas_space(ui, space, |ui| show_body(app, ui, &space, pass.as_ref(), win, kind, bar_shapes)); - body.arc_turn = arc_turn; + body.arc_view = arc_turn.then_some(arc_view); } }); let output = shown.output; @@ -269,7 +279,7 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin rulers::apply(app, ui, out); } let pressed = matches!(output.press.phase, PressPhase::Down { .. }); - let Body { reply, context_at, context_key, edited, arc_turn } = body; + let Body { reply, context_at, context_key, edited, arc_view } = body; let request = reply .as_ref() .and_then(|r| r.context.as_ref()) @@ -277,13 +287,11 @@ pub(crate) fn show_document(app: &mut VectorcraftApp, ui: &mut Ui, win: Win, kin .or(context_at.map(|at| context_menu::Request { at, key: context_key })); let jumped = edited.is_some(); // Presentation Mode keeps its view through a drag of the middle button, which the canvas pans on its own, and a - // wheel turn the Quick Pen tool takes for its arc size keeps the view the pass began with. + // wheel turn the Quick Pen tool takes for its arc size leaves other view requests in place. let view_now = if presenting && ui.input(|i| i.pointer.middle_down()) { given - } else if arc_turn { - edited.unwrap_or(given) } else { - edited.or(reply.and_then(|r| r.view)).or(output.view).unwrap_or(cv) + edited.or(reply.and_then(|r| r.view)).or(arc_view).or(output.view).unwrap_or(cv) }; if let Some(view) = doc_windows::view_mut(app, win) { view.set_canvas(&view_now, scaling); diff --git a/crates/ui-egui/src/canvas/quick_pen_wheel.rs b/crates/ui-egui/src/canvas/quick_pen_wheel.rs index f914413a95..96616e3b1d 100644 --- a/crates/ui-egui/src/canvas/quick_pen_wheel.rs +++ b/crates/ui-egui/src/canvas/quick_pen_wheel.rs @@ -69,7 +69,9 @@ fn fine(wheel: &Wheel, lines: f32) -> bool { pub(super) fn control_turn(app: &VectorcraftApp, wheel: &Wheel) -> bool { let line = crate::app::view::navigation(&app.session.prefs).wheel_line.max(1.0); let mods = if fine(wheel, lines(wheel, line)) { wheel.held } else { wheel.mods }; - ctrl_alone(mods, crate::keymap::platform()) + let scrolling = + (wheel.scroll.is_finite() && wheel.scroll != egui::Vec2::ZERO) || (wheel.zoom_lines.is_finite() && wheel.zoom_lines != egui::Vec2::ZERO); + ctrl_alone(mods, crate::keymap::platform()) && (wheel.claimed || scrolling) } /// Whole lines in `v`, toward zero, with [`LINE_SLACK`] for rounding. @@ -119,10 +121,11 @@ pub(super) fn arc_size(app: &mut VectorcraftApp, ctx: &egui::Context, space: &Ca let muted = w.modal || app_modal; let line = crate::app::view::navigation(&app.session.prefs).wheel_line.max(1.0); let over_bar = w.at.zip(bar).is_some_and(|(at, bar)| bar.contains(at)); + let over_content = w.at.is_some_and(|at| space.view.rect.contains(at)); let quick_pen = app.session.tool_id() == vectorcraft_tools::quickpen::ID; let mut taken = w.claimed; let mut runs = 0.0; - if quick_pen && !muted && !over_bar && control_turn(app, &w) { + if quick_pen && !muted && !over_bar && over_content && control_turn(app, &w) { let mut rest = w.claimed_spent.x; let made = steps(&w, line, &mut rest); // A share of a gesture another scroller owns cannot be claimed; the tool still takes it, as the diff --git a/crates/ui-egui/src/tests/quickpenwheel.rs b/crates/ui-egui/src/tests/quickpenwheel.rs index dba5367ebe..98c3a82e13 100644 --- a/crates/ui-egui/src/tests/quickpenwheel.rs +++ b/crates/ui-egui/src/tests/quickpenwheel.rs @@ -2,6 +2,7 @@ //! is; the arc size commands step it as `[` and `]` do. use craft::behavior::CanvasView; +use craft::ui::canvas::{ViewCommands, ViewRequest}; use egui::{Event, Modifiers, MouseWheelSource, MouseWheelUnit, Pos2, TouchPhase, vec2}; use serde_json::json; use vectorcraft_doc::NodeKind; @@ -138,6 +139,7 @@ fn ctrl_wheel_changes_the_arc_size_and_not_the_view() { #[test] fn the_first_ctrl_wheel_frame_keeps_the_view_and_pointer() { let mut app = app(); + app.ui.view.rulers = true; on_canvas(&mut app, |rig| { rig.fx.settle(); let at = center(rig) + vec2(80.0, 40.0); @@ -151,11 +153,84 @@ fn the_first_ctrl_wheel_frame_keeps_the_view_and_pointer() { assert_eq!(arc_size(rig), 195.0); assert_eq!(view(rig).zoom, still.zoom, "the first share keeps the zoom"); assert_eq!(view(rig).center, still.center, "the first share keeps the pan"); + assert_eq!(view(rig).rect, still.rect, "the content stays inside the rulers"); assert_eq!(craft::ui::canvas::ToolHost::shown_space(rig.fx.ctx(), id).unwrap().view, shown, "the tool host sees the saved view"); assert_eq!(rig.app().hover_doc, Some(point), "the tool host uses the saved view in the same frame"); }); } +#[test] +fn a_queued_fit_survives_the_first_ctrl_wheel_frame() { + let mut app = app(); + app.session.prefs.animated_zoom = false; + on_canvas(&mut app, |rig| { + rig.fx.settle(); + let fitted = view(rig); + rig.app().run("view.zoomIn", json!({})).unwrap(); + rig.fx.settle(); + assert_ne!(view(rig).zoom, fitted.zoom); + rig.fx.frame(vec![Event::PointerMoved(center(rig))]); + rig.app().request_view(ViewRequest::Command(ViewCommands::FitArtboard), None); + rig.fx.frame(vec![notch(1.0, ctrl())]); + assert_eq!(arc_size(rig), 195.0); + assert_eq!(view(rig), fitted, "the queued fit reaches the stored view in the same frame"); + }); +} + +#[test] +fn the_toolbar_keeps_its_anchor_on_the_first_ctrl_wheel_frame() { + let mut app = app(); + on_canvas(&mut app, |rig| { + rig.fx.settle(); + click_doc(rig, 100.0, 150.0); + rig.fx.settle(); + let bar = rig.target("Quick Pen").unwrap().rect; + rig.fx.frame(vec![Event::PointerMoved(center(rig) + vec2(-120.0, -80.0))]); + rig.fx.frame(vec![notch(1.0, ctrl())]); + assert_eq!(arc_size(rig), 195.0); + assert_eq!(rig.target("Quick Pen").unwrap().rect, bar, "the toolbar maps its anchor through the saved space"); + }); +} + +#[test] +fn a_claimed_wheel_makes_no_step_outside_the_content() { + let mut app = app(); + app.ui.view.rulers = true; + on_canvas(&mut app, |rig| { + rig.fx.settle(); + rig.fx.frame(vec![Event::PointerMoved(center(rig))]); + let still = view(rig); + rig.fx.frame(vec![notch(1.0, ctrl())]); + assert_eq!(arc_size(rig), 195.0); + let outside = egui::pos2(still.rect.left() - 1.0, still.rect.center().y); + rig.fx.frame(vec![Event::PointerMoved(outside)]); + rig.fx.frame(vec![notch(1.0, ctrl())]); + assert_eq!(arc_size(rig), 195.0, "a share over a ruler makes no step"); + assert_eq!(view(rig), still, "the claimed gesture still keeps the view"); + rig.fx.frame(vec![Event::PointerMoved(center(rig))]); + rig.fx.frame(vec![notch(1.0, ctrl())]); + assert_eq!(arc_size(rig), 210.0, "the gesture resumes inside the content"); + }); +} + +#[test] +fn a_native_pinch_with_control_zooms_the_view() { + let mut app = app(); + on_canvas(&mut app, |rig| { + rig.fx.settle(); + rig.fx.hold(ctrl()); + rig.fx.frame(vec![Event::PointerMoved(center(rig))]); + let still = view(rig); + rig.fx.frame(vec![Event::Zoom(1.25)]); + assert!(view(rig).zoom > still.zoom, "a native pinch keeps its zoom"); + assert_eq!(arc_size(rig), 180.0); + let zoomed = view(rig); + rig.fx.frame(vec![Event::Zoom(1.25)]); + assert!(view(rig).zoom > zoomed.zoom, "the pinch was not claimed as an arc gesture"); + rig.fx.hold(Modifiers::NONE); + }); +} + /// Opposite notches in one frame use the framework's net lines and keep the tool host's view. #[test] fn opposite_notches_use_the_frameworks_reported_net_motion() { diff --git a/docs/target-app-parity.md b/docs/target-app-parity.md index cbf285df6c..4928ac34a6 100644 --- a/docs/target-app-parity.md +++ b/docs/target-app-parity.md @@ -706,7 +706,7 @@ since 2026-10-01. - **Recolor picker follow-up (#8031/#4028):** native Lab numeric entry, document/loaded-library swatches in the Color Picker, and Assign-row Pick from Swatches / Limit to Library menus. #4090 provided the double-click picker and #5113 the Assign sliders. Regression tests `native_lab_entry_in_color_picker` and `row_context_menu_pick_from_swatches_and_limit_to_library` exercise the fields and menu callbacks rather than writing their result state. Area score and hours unchanged. - **Quick Pen editing (#2660):** with no path being drawn, the Quick Pen tool moves an anchor or a segment of a selected path by a drag (`path.moveAnchors` with `interpolate`, one undo step; beside a moved corner anchor a line stays a line and an arc an arc, and at a moved smooth anchor the handles stay in line and the segments bend to meet), selects an anchor with a click and adds one with Shift-click, and the canvas context menu's Delete removes the selected anchors (`edit.clear`), as [Draw with the Quick Pen tool](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.html) describes. Which presses select and which move, and the drag snapping only an anchor, are VectorCraft's own rules. Tests: tools `quickpen::tests::a_selected_paths_anchors_and_segments_show_the_edit_cursors`, engine `tests::quickpen` (`a_drag_on_an_anchor_moves_it_and_the_arc_stays_an_arc`, `a_drag_on_a_segment_moves_its_ends`, `a_drag_on_an_open_end_moves_it`, `a_release_past_the_drag_distance_moves_the_anchor`, `clicks_select_anchors_for_delete`, `escape_takes_back_an_anchor_drag`, `a_press_while_drawing_adds_a_piece`), ui-egui `tests::contextmenu::the_quick_pen_menu_deletes_the_selected_anchors`. Score and hours unchanged. - **Recolor with Preset asks for a library first:** Edit › Edit Colors › Recolor with Preset (1, 2 and 3 Color Job, Color Library) opens a Recolor with Preset dialog whose Limit to Library menu (None, Document Swatches or a library) is applied when Recolor Artwork opens (, "Quickly reduce colors using a preset"). A 1 Color Job limited to the document's swatches with a spot or global ink picked turns gray art into tints of that ink linked to its swatch, so editing the swatch recolors the art. Tests `recolor_with_preset_asks_for_a_library_first` and `a_one_color_job_limited_to_document_swatches_links_gray_art_to_the_ink`. Area score and hours unchanged. -- **Quick Pen tool (#2660, in part):** a tool in the Pen tool's group (Alt+P, Option+P on macOS) draws straight lines, continuous arcs and sharp-corner arcs, one undo step per piece; Alt pressed and let go on its own switches the action, C flips the last sharp-corner arc, `[` and `]` and Ctrl with a touchpad scroll or a mouse wheel over the canvas change the arc size by 15° (`tool.quickPen.arcLarger`, `tool.quickPen.arcSmaller`), a click on the first point closes the path, a click on an open end continues it, and Escape or Enter ends it (`path.quickPen`), as [Draw with the Quick Pen tool](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.html) and [Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html) describe. The 180° default arc, its 15° steps, the side an arc bulges to, a dragged piece ending where the press is let go, C, `[` and `]` changing the arc being dragged, the mouse wheel changing the arc size, and one step per wheel event of a mouse wheel are VectorCraft's own rules. Tests: tools `quickpen::tests`, engine `tests::quickpen`, ui-egui `shortcuts::alt_tap::tests`, `tests::quickpenwheel`, `alt_p_chooses_the_quick_pen_and_an_alt_tap_switches_its_action` and `brackets_size_the_quick_pen_arc_being_dragged`. Score and hours unchanged. +- **Quick Pen tool (#2660, in part):** a tool in the Pen tool's group (Alt+P, Option+P on macOS) draws straight lines, continuous arcs and sharp-corner arcs, one undo step per piece; Alt pressed and let go on its own switches the action, C flips the last sharp-corner arc, `[` and `]` and Ctrl with a touchpad scroll or a mouse wheel over the canvas change the arc size by 15° (`tool.quickPen.arcLarger`, `tool.quickPen.arcSmaller`), a click on the first point closes the path, a click on an open end continues it, and Escape or Enter ends it (`path.quickPen`), as [Draw with the Quick Pen tool](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/draw-with-quick-pen-tool.html) and [Quick Pen tool keyboard shortcuts](https://helpx.adobe.com/illustrator/web/add-and-edit-artwork/draw-and-edit-paths/quick-pen-tool-keyboard-shortcuts.html) describe. The 180° default arc, its 15° steps, the side an arc bulges to, a dragged piece ending where the press is let go, C, `[` and `]` changing the arc being dragged, the mouse wheel changing the arc size, and one step per net whole wheel line of a mouse wheel are VectorCraft's own rules. Tests: tools `quickpen::tests`, engine `tests::quickpen`, ui-egui `shortcuts::alt_tap::tests`, `tests::quickpenwheel`, `alt_p_chooses_the_quick_pen_and_an_alt_tap_switches_its_action` and `brackets_size_the_quick_pen_arc_being_dragged`. Score and hours unchanged. - **Quick Pen protractor:** while an arc is drawn, by a drag or as the piece the next click adds, the Quick Pen tool shows a protractor around the arc's center: a tick every 15° from the arc's start, a longer one every 90°, and one at its end; the next click's piece shows it only with Enable Rubber Band for the Pen tool on. With Smart Guides on, the end of a continuous arc snaps onto the nearest tick within the snapping tolerance of the pointer when no other Smart Guide snaps the point and neither Snap to Grid nor Snap to Pixel snaps drawn points; Shift does not change it. A continuous arc that starts a path sweeps the arc size and does not snap to a tick, Alt tapped during a press moves the piece's end onto or off the tick for the new action, and a hover hides its preview after a snap setting changes until the pointer moves. The protractor, its 15° step and the tick snapping are VectorCraft's own behavior. Tests: tools `the_arc_circle_is_the_circle_the_arc_is_drawn_on`, `a_continuous_arc_end_goes_to_the_nearest_tick`, `a_tick_past_the_coordinate_limit_is_not_used`, `a_continuous_arc_without_a_direction_has_no_tick`, `the_protractor_ticks_lie_across_the_arc`; engine `a_continuous_arc_end_snaps_to_the_protractor`, `a_click_puts_a_continuous_arc_end_on_a_tick`, `an_alt_tap_during_a_press_moves_the_end_for_the_new_action`, `a_click_on_a_tick_leaves_no_preview_back_to_the_pointer`, `a_hover_snaps_to_a_tick_only_for_a_continuous_arc`, `a_hover_shows_nothing_after_smart_guides_change`, `a_click_that_adds_nothing_keeps_a_stale_hover_hidden`, `a_hover_is_hovered_again_when_the_art_changes`, `an_arc_drag_shows_the_protractor`, `a_hovered_arc_shows_the_protractor_with_the_rubber_band`. New tests of existing Quick Pen behavior: `a_point_snaps_to_a_smart_guide`, `hovering_shows_the_distance_label`. Score and hours unchanged. - **Quick Pen arc center:** wherever the Quick Pen tool shows an arc's protractor, it also marks the arc's center with a small cross. The cross is VectorCraft's own behavior. Test: engine `an_arc_shows_a_cross_at_its_center`. Score and hours unchanged. From 1dbbf874361974c88fe2770d2c1303b37a104e28 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 21:56:24 -0800 Subject: [PATCH 08/11] Tests: guards check the environment, not the output under test Several tests returned early when the code under test gave back nothing, so the regression they guard against passed. Each of those guards now checks only what the host provides (an installed face, the bundled fonts), and the output itself is asserted: - PDF live text: the lam-alef face is no longer picked by whether its type imports (#6072); Insert Kashidas asserts the kashida and the imported type. - Effects and Expand Appearance on type assert the outlines and the drawn type when the default face is installed. - The OpenType panel's Stylistic Sets test asserts sets with the bundled fonts. - Thumbnail worker tests assert that the worker starts; the memory peak test asserts a reading. - The json2 test checks the interpreter's Date, replace and RegExp on every run, before looking for json2.js. - Devanagari arrow keys and the Arabic narrow-area wrap assert the layout they set up. --- apps/vectorcraft-cli/src/perf.rs | 3 +-- crates/effects/src/tests/rasterfollow.rs | 20 ++++++++++++++++---- crates/engine/src/tests/objexpand.rs | 6 ++++-- crates/js/tests/json2.rs | 14 +++++--------- crates/pdf/src/tests/live_text.rs | 6 +++--- crates/pdf/src/tests/realtext.rs | 18 +++++++----------- crates/text/src/layout/wrapping_tests.rs | 8 ++++---- crates/tools/src/text/tests.rs | 13 +------------ crates/ui-egui/src/panels/opentype.rs | 3 ++- crates/ui-egui/src/thumb_worker.rs | 4 ++-- 10 files changed, 45 insertions(+), 50 deletions(-) diff --git a/apps/vectorcraft-cli/src/perf.rs b/apps/vectorcraft-cli/src/perf.rs index e533d00b73..ca0108f955 100644 --- a/apps/vectorcraft-cli/src/perf.rs +++ b/apps/vectorcraft-cli/src/perf.rs @@ -654,8 +654,7 @@ mod tests { let held = rss_mb(); drop(buffer); let (Some((held, _)), Some((now, peak))) = (held, rss_mb()) else { - eprintln!("no memory reading (Linux without `ps`): nothing to check"); - return; + panic!("rss_mb gave no memory reading"); }; assert!(peak.is_some_and(|peak| peak > held - 16.0), "holding 64 MB: {held:.1} MB, after freeing it: {now:.1} MB, peak {peak:?}"); } diff --git a/crates/effects/src/tests/rasterfollow.rs b/crates/effects/src/tests/rasterfollow.rs index db34010c22..d0e4939e8e 100644 --- a/crates/effects/src/tests/rasterfollow.rs +++ b/crates/effects/src/tests/rasterfollow.rs @@ -1035,10 +1035,11 @@ fn a_baked_group_with_type_keeps_a_shadow_on_each_copy() { use vectorcraft_doc::text::{CharStyle, TextObject}; let style = CharStyle { size: 40.0, fill: Paint::solid(Color::BLACK), ..Default::default() }; let words = Node::new(NodeId(161), vectorcraft_doc::NodeKind::Text(Box::new(TextObject::point(Point::new(5.0, 60.0), "IIII", style)))); - if !crate::outline_text(&words).is_some_and(|o| paths_in(&o) > 0) { + if !fonts() { eprintln!("skipped: built without fonts (enable vectorcraft-text's bundled-fonts to run it)"); return; } + assert!(crate::outline_text(&words).is_some_and(|o| paths_in(&o) > 0), "the type outlines to paths"); let g = group(160, vec![words, square(162, vec![])], vec![shadow(10.0, 0.0, 0.0), transform(json!({"moveH": 150, "copies": 1}))]); let b = baked(g); assert!(near(&shadows_in(&b), &[(10.0, 0.0), (10.0, 0.0)]), "{:?}", shadows_in(&b)); @@ -1640,6 +1641,17 @@ fn type_node(id: u64, effects: Vec) -> Node { n } +/// Whether the face of the default character style is installed, so that type lays out glyphs. +/// When it is, `type_node`'s type must outline to paths. +fn fonts() -> bool { + let style = vectorcraft_doc::text::CharStyle::default(); + if vectorcraft_text::FontDb::global().face(&style.font_family, &style.font_style).is_none() { + return false; + } + assert!(crate::outline_text(&type_node(95, vec![])).is_some_and(|o| paths_in(&o) > 0), "{}: the type outlines to paths", style.font_family); + true +} + /// An instance at (50, 50) with `effects` of a symbol, and the symbol's art: a black 20 pt square /// centered on its origin. fn instance(id: u64, effects: Vec) -> (Node, Node) { @@ -1660,7 +1672,7 @@ fn instance(id: u64, effects: Vec) -> (Node, Node) { /// image and the instance are checked. #[test] fn each_copy_of_type_an_image_or_a_symbol_instance_carries_the_shadow_listed_before_it() { - let fonts = crate::outline_text(&type_node(95, vec![])).is_some_and(|o| paths_in(&o) > 0); + let fonts = fonts(); if !fonts { eprintln!("type skipped: built without fonts (enable vectorcraft-text's bundled-fonts to run it)"); } @@ -1702,7 +1714,7 @@ fn each_copy_of_type_an_image_or_a_symbol_instance_carries_the_shadow_listed_bef /// listed before that effect, as the canvas draws it, rather than staying type under one shadow. #[test] fn baked_type_whose_transform_moves_its_copies_keeps_a_shadow_on_each() { - if !crate::outline_text(&type_node(99, vec![])).is_some_and(|o| paths_in(&o) > 0) { + if !fonts() { eprintln!("skipped: built without fonts (enable vectorcraft-text's bundled-fonts to run it)"); return; } @@ -1738,7 +1750,7 @@ fn type_carries_its_fills_shadow_on_each_copy() { n }; let copying = vec![shadow(10.0, 0.0, 0.0), transform(json!({"moveH": 100, "copies": 1}))]; - if !crate::outline_text(&type_node(95, vec![])).is_some_and(|o| paths_in(&o) > 0) { + if !fonts() { eprintln!("type skipped: built without fonts (enable vectorcraft-text's bundled-fonts to run it)"); return; } diff --git a/crates/engine/src/tests/objexpand.rs b/crates/engine/src/tests/objexpand.rs index ffa8e83f40..7ae627e546 100644 --- a/crates/engine/src/tests/objexpand.rs +++ b/crates/engine/src/tests/objexpand.rs @@ -445,11 +445,13 @@ fn each_copys_shadow_on_type_expands_as_the_canvas_draws_it() { let shadow = json!({"x": 20, "y": 0, "blur": 0, "opacity": 100, "mode": "normal", "color": "#00ff00"}); run(&mut s, "effect.apply", json!({"effect": "stylize.dropShadow", "params": shadow})); run(&mut s, "effect.apply", json!({"effect": "distort.transform", "params": {"scaleH": 200, "scaleV": 200, "moveV": 80, "copies": 1}})); - let before = render(&s); - if !(0..100u32).any(|y| (0..200u32).any(|x| before.pixel(x, y) == [255, 0, 0, 255])) { + let style = vectorcraft_doc::text::CharStyle::default(); + if vectorcraft_text::FontDb::global().face(&style.font_family, &style.font_style).is_none() { eprintln!("skipped: built without a font that draws the type"); return; } + let before = render(&s); + assert!((0..100u32).any(|y| (0..200u32).any(|x| before.pixel(x, y) == [255, 0, 0, 255])), "the type draws in red"); // The rightmost red pixel of the copy, below the type, and 38 pt right of it the copy's shadow. let red = (100..200u32).flat_map(|y| (0..200u32).map(move |x| (x, y))).filter(|&(x, y)| before.pixel(x, y) == [255, 0, 0, 255]).max_by_key(|p| p.0); diff --git a/crates/js/tests/json2.rs b/crates/js/tests/json2.rs index af408a4fef..521040373e 100644 --- a/crates/js/tests/json2.rs +++ b/crates/js/tests/json2.rs @@ -68,20 +68,16 @@ problem; #[test] fn json2_polyfill_round_trips_with_the_built_in_json() { + let mut realm = Realm::new(); + match realm.run(NEEDS) { + Ok(JsValue::Bool(true)) => {} + other => panic!("json2: the interpreter lacks Date, String.prototype.replace or RegExp, which json2.js uses: {other:?}"), + } let Some(path) = json2_file() else { println!("json2: SKIPPED (no json2.js; run cargo xtask test262)"); return; }; let source = std::fs::read_to_string(&path).unwrap_or_else(|e| panic!("{}: {e}", path.display())); - let mut realm = Realm::new(); - match realm.run(NEEDS) { - Ok(JsValue::Bool(true)) => {} - Ok(JsValue::Bool(false)) => { - println!("json2: SKIPPED (the interpreter lacks Date, String.prototype.replace or RegExp, which json2.js uses)"); - return; - } - other => panic!("json2: the built-in check failed: {other:?}"), - } match realm.run(&format!("{BEFORE}\n{source}\n{ROUND_TRIP}")) { Ok(JsValue::String(s)) if s == "ok" => println!("json2: the polyfill and the built-in JSON agree on every sample"), other => panic!("json2: {other:?}"), diff --git a/crates/pdf/src/tests/live_text.rs b/crates/pdf/src/tests/live_text.rs index 90341ca28b..60a20079d6 100644 --- a/crates/pdf/src/tests/live_text.rs +++ b/crates/pdf/src/tests/live_text.rs @@ -503,13 +503,13 @@ fn arabic_ligatures_keep_their_letters_in_order() { let t = TextObject::point(kurbo::Point::ORIGIN, "لا", style); vectorcraft_text::layout(db, &t).glyphs.len() == 1 }; - // An installed Arabic font with a lam-alef ligature whose glyphs come back as live type. + // An installed Arabic font with a lam-alef ligature. The test checks that its type comes + // back, so the choice of font does not depend on the import. let Some(face) = preferred .iter() .chain(&db.families()) .filter_map(|f| db.face(f, "Regular")) - .filter(|f| f.covers('\u{0644}') && f.covers('\u{0627}') && ligates(f)) - .find(|f| !imported_texts(f, "بب").is_empty()) + .find(|f| f.covers('\u{0644}') && f.covers('\u{0627}') && ligates(f)) else { return; // No such font on this host. }; diff --git a/crates/pdf/src/tests/realtext.rs b/crates/pdf/src/tests/realtext.rs index 7fcd06dd56..5f4ef0205f 100644 --- a/crates/pdf/src/tests/realtext.rs +++ b/crates/pdf/src/tests/realtext.rs @@ -202,8 +202,7 @@ fn line_break_hyphens_of_right_to_left_lines_are_written_as_text_where_the_canva /// The kashidas of justified Arabic type (Insert Kashidas), which stand for no character either, /// are drawn as paths: reopened, the type holds its letters and no hyphen or tatweel. Skipped -/// without an OpenType font that covers Arabic and the tatweel, when the layout adds no kashida, -/// or when PDF text import returns no strings on this platform. +/// without an OpenType font that covers Arabic and the tatweel. #[test] fn kashidas_are_not_written_as_hyphens() { let db = FontDb::global(); @@ -221,20 +220,17 @@ fn kashidas_are_not_written_as_hyphens() { t.para.justify = vectorcraft_doc::Justify::JustifyAll; t.para.kashida = vectorcraft_doc::text::Kashida::Medium; let tatweel = face.glyph_for('\u{0640}'); - if !vectorcraft_text::layout(db, &t).glyphs.iter().any(|g| g.len == 0 && g.gid == tatweel) { - return; - } + assert!( + vectorcraft_text::layout(db, &t).glyphs.iter().any(|g| g.len == 0 && g.gid == tatweel), + "{}: justified layout inserts a kashida", + face.family + ); let back = texts(&import_as(&pdf(&doc(vec![t]), false).bytes, TextAs::Text)); - if back.is_empty() { - return; - } + assert!(!back.is_empty(), "{}: the PDF's type comes back", face.family); assert!(!back.concat().contains(['-', '\u{2010}', '\u{0640}']), "{back:?}"); // Every letter comes back, at least as often as the text holds it (the justified words may // come back as type objects of their own). let all = back.concat(); - if all.is_empty() { - return; - } let count = |s: &str, c: char| s.chars().filter(|&x| x == c).count(); for c in text.chars().filter(|c| c.is_alphabetic()) { assert!(count(&all, c) >= count(text, c), "{c}: {back:?}"); diff --git a/crates/text/src/layout/wrapping_tests.rs b/crates/text/src/layout/wrapping_tests.rs index 225e58a053..5164dd1998 100644 --- a/crates/text/src/layout/wrapping_tests.rs +++ b/crates/text/src/layout/wrapping_tests.rs @@ -228,11 +228,10 @@ fn narrow_arabic_area_wrap_keeps_base_and_mark_together_when_supported() { let levels = bidi.as_ref().map_or(&[][..], |info| &info.levels); let mut shaped = Vec::new(); shape_range(db, text, 0..text.len(), &[(0..text.len(), &style)], &[], &OtFeatures::default(), levels, &mut shaped); - let Some(first) = shaped.first() else { return }; + let first = shaped.first().expect("the text shapes to glyphs"); let first_end = shaped.iter().take_while(|g| g.byte == first.byte).count(); - if first.byte != 0 || first_end < 2 || first_end >= shaped.len() { - return; - } + assert_eq!(first.byte, 0, "{}: the first cluster starts the text: {shaped:?}", face.family); + assert!(first_end >= 2 && first_end < shaped.len(), "{}: the base and its mark are one cluster of two glyphs: {shaped:?}", face.family); // Pick a narrow width that fits glyphs before one positive-advance glyph but not that next // glyph. This ensures the old per-glyph loop would have returned inside the first cluster. let mut prefix = shaped.first().map_or(0.0, |g| g.adv); @@ -245,6 +244,7 @@ fn narrow_arabic_area_wrap_keeps_base_and_mark_together_when_supported() { None } }); + // A face whose mark has no advance gives no width that splits the cluster. let Some(width) = width else { return }; let mut object = TextObject::point(Point::ZERO, text, style); diff --git a/crates/tools/src/text/tests.rs b/crates/tools/src/text/tests.rs index c6211550b3..ac4355e3a2 100644 --- a/crates/tools/src/text/tests.rs +++ b/crates/tools/src/text/tests.rs @@ -183,12 +183,7 @@ fn type_arrows_keep_devanagari_clusters_across_wrapped_lines() { let split_width: f64 = hindi_glyphs.iter().filter(|g| g.byte == split).map(|g| g.advance).sum(); assert!(prefix_width.is_finite() && prefix_width > 0.0, "setup: prefix has positive finite advance"); assert!(split_width.is_finite(), "setup: the internal raw-group advance is finite"); - if split_width <= 0.0 { - eprintln!( - "SKIPPED: type_arrows_keep_devanagari_clusters_across_wrapped_lines; layout capability: the selected face has no positive-advance raw group at internal byte {split}" - ); - return; - } + assert!(split_width > 0.0, "setup: {} lays out a positive-advance raw group at internal byte {split}", face.family); let width = prefix_width + split_width * 0.5; assert!(width.is_finite() && width > prefix_width && width < prefix_width + split_width, "setup: one measured width separates the raw groups"); @@ -205,12 +200,6 @@ fn type_arrows_keep_devanagari_clusters_across_wrapped_lines() { assert_eq!(edit::prev_cluster(text, hindi.len()), second, "setup: logical cluster start is 6"); assert_eq!(edit::prev_cluster(text, split), second, "setup: raw line endpoint 12 is inside the grapheme"); assert_eq!(edit::next_cluster(text, split), hindi.len(), "setup: raw line endpoint 12 is not its end"); - if lay.lines.len() < 2 || (lay.lines[0].start, lay.lines[0].end, lay.lines[1].start) != (0, split, split) { - eprintln!( - "SKIPPED: type_arrows_keep_devanagari_clusters_across_wrapped_lines; layout capability: the measured frame does not expose adjacent wrapped endpoints at internal byte {split}" - ); - return; - } assert!(lay.lines.len() >= 2, "setup: actual wrapping occurred"); assert_eq!( (lay.lines[0].start, lay.lines[0].end, lay.lines[1].start), diff --git a/crates/ui-egui/src/panels/opentype.rs b/crates/ui-egui/src/panels/opentype.rs index 8715d02401..b2c8f2cbe2 100644 --- a/crates/ui-egui/src/panels/opentype.rs +++ b/crates/ui-egui/src/panels/opentype.rs @@ -855,7 +855,8 @@ mod tests { let mut app = selected_text(); let Some((st, _)) = text_style(&app) else { panic!("no text style") }; let sets = set_entries(&app, &st); - // Builds without the bundled fonts have no face that offers sets. + // With the bundled fonts, the text's face offers sets. Without them, an installed face may. + assert!(!cfg!(feature = "bundled-fonts") || !sets.is_empty(), "the bundled face of the text offers stylistic sets"); let Some((first, flag, _)) = sets.first() else { return }; let (label, tag) = (set_label(first), flag.tag().unwrap()); set(&mut app, OtFeatures { small_caps: true, ..Default::default() }); diff --git a/crates/ui-egui/src/thumb_worker.rs b/crates/ui-egui/src/thumb_worker.rs index e9898a078f..5e7c48758c 100644 --- a/crates/ui-egui/src/thumb_worker.rs +++ b/crates/ui-egui/src/thumb_worker.rs @@ -214,7 +214,7 @@ mod tests { #[test] fn jobs_come_back_newest_last_per_slot() { - let Some(w) = ThumbWorker::::start(&crate::testing::ui_context(), "test") else { return }; + let w = ThumbWorker::::start(&crate::testing::ui_context(), "test").expect("the worker thread starts"); let job = |n: u32| -> JobFn { Box::new(move |_| Some(Rendered { width: n, height: 1, pixels: vec![0; 4] })) }; for k in 1..=3 { assert!(w.submit(0, k, job(k))); @@ -238,7 +238,7 @@ mod tests { #[test] fn discarded_jobs_do_not_run_and_the_running_one_finishes() { - let Some(w) = ThumbWorker::::start(&crate::testing::ui_context(), "test") else { return }; + let w = ThumbWorker::::start(&crate::testing::ui_context(), "test").expect("the worker thread starts"); let job = |n: u32| -> JobFn { Box::new(move |_| Some(Rendered { width: n, height: 1, pixels: vec![0; 4] })) }; // A job that holds the thread until it is let go, so the others queue behind it. let (started, running) = channel::<()>(); From 7407da03c8787b488d8d3b0ec5750a22e6fa1bd6 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 1 Dec 2026 01:35:17 -0800 Subject: [PATCH 09/11] Tests: the Stylistic Sets submenu test reads the sets from the face The test reads the expected ss01 to ss20 sets from the text's face, compares them with the panel's entries and with the submenu's toggle rows in order, and checks that the submenu is left out when the face offers no sets. Before, a face whose sets the panel dropped returned early and skipped every submenu assertion. --- crates/ui-egui/src/panels/opentype.rs | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/crates/ui-egui/src/panels/opentype.rs b/crates/ui-egui/src/panels/opentype.rs index b2c8f2cbe2..d61efcb289 100644 --- a/crates/ui-egui/src/panels/opentype.rs +++ b/crates/ui-egui/src/panels/opentype.rs @@ -857,6 +857,36 @@ mod tests { let sets = set_entries(&app, &st); // With the bundled fonts, the text's face offers sets. Without them, an installed face may. assert!(!cfg!(feature = "bundled-fonts") || !sets.is_empty(), "the bundled face of the text offers stylistic sets"); + // The submenu lists the `ss01` to `ss20` sets that the text's face offers, read here from + // the face itself, so the test returns early only when the face offers none. + let db = FontDb::global(); + let available = db.has_family(&db.canonical(&st.font_family, &st.font_style).0); + let face_sets = if available { db.style_face(&st).map(|face| face.stylistic_sets()).unwrap_or_default() } else { Vec::new() }; + let expected: Vec = face_sets.iter().filter(|set| (1..=20).contains(&set.number)).map(|set| format!("ss{:02}", set.number)).collect(); + let listed: Vec = sets.iter().map(|(_, flag, _)| flag.tag().unwrap_or_default().to_string()).collect(); + assert_eq!(listed, expected, "the submenu lists the stylistic sets of the text's face"); + let rows = menu_rows(&app); + if expected.is_empty() { + assert!(!rows.iter().any(|row| matches!(row, PanelRow::Submenu(..))), "the submenu is left out when the face offers no sets"); + } else { + let submenu = rows.iter().find_map(|row| match row { + PanelRow::Submenu(_, sub) if (1..=20).any(|number| has_row(sub, &toggle_ref(&format!("ss{number:02}")))) => Some(sub), + _ => None, + }); + let actual: Vec<&str> = submenu + .expect("the menu has a Stylistic Sets submenu") + .iter() + .filter_map(|row| match row { + PanelRow::Command(c) if c.id == TOGGLE => Some(c.params["tag"].as_str().expect("a toggle has a tag")), + _ => None, + }) + .collect(); + assert_eq!(actual, expected, "the submenu toggle tags match the face's sets in order"); + } + for tag in &expected { + let r = toggle_ref(tag); + assert!(rows.iter().any(|row| matches!(row, PanelRow::Submenu(_, sub) if has_row(sub, &r))), "the submenu has a row for {tag}"); + } let Some((first, flag, _)) = sets.first() else { return }; let (label, tag) = (set_label(first), flag.tag().unwrap()); set(&mut app, OtFeatures { small_caps: true, ..Default::default() }); From 6441c1b95be15cb4d4e899d8c059d12575af89c9 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 1 Dec 2026 02:08:22 -0800 Subject: [PATCH 10/11] Tests: check exact values in panel and dialog tests Eleven assertions in the ui-egui Desaturate, Brush delete, Blend, Color Wheel, Color Balance, Remove Background and Document Info tests accepted halved, doubled or off-by-a-step values. Each now checks the value the test asks for. --- crates/ui-egui/src/addons/image/tests.rs | 3 +-- crates/ui-egui/src/dialogs/brush_delete/tests.rs | 3 ++- crates/ui-egui/src/dialogs/color_balance.rs | 4 ++-- crates/ui-egui/src/panels/doc_info.rs | 2 +- crates/ui-egui/src/panels/tests_blend.rs | 6 +++--- crates/ui-egui/src/panels/tests_color_wheel_hex.rs | 2 +- crates/ui-egui/src/panels/tests_color_wheel_opacity.rs | 4 ++-- crates/ui-egui/src/tests/plugins.rs | 6 ++++-- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/crates/ui-egui/src/addons/image/tests.rs b/crates/ui-egui/src/addons/image/tests.rs index 154972dec7..3239ca6f00 100644 --- a/crates/ui-egui/src/addons/image/tests.rs +++ b/crates/ui-egui/src/addons/image/tests.rs @@ -248,6 +248,5 @@ fn properties_and_the_control_bar_remove_the_background_at_once() { assert!(closed(&app), "it runs at once"); assert_eq!(steps(&app), n + 1, "one undo step"); // The defaults (tolerance and softness 10): the white goes, the near-white ring fades. - let [corner, ring, block] = alphas(&app); - assert!(corner == 0 && ring > 0 && ring < 255 && block == 255, "{:?}", alphas(&app)); + assert_eq!(alphas(&app), [0, 95, 255]); } diff --git a/crates/ui-egui/src/dialogs/brush_delete/tests.rs b/crates/ui-egui/src/dialogs/brush_delete/tests.rs index b712b589d9..402a2b1922 100644 --- a/crates/ui-egui/src/dialogs/brush_delete/tests.rs +++ b/crates/ui-egui/src/dialogs/brush_delete/tests.rs @@ -84,13 +84,14 @@ fn remove_strokes_runs_the_delete_and_cancel_changes_nothing() { let name = "10 pt. Oval"; app.run("brush.apply", json!({"name": name})).unwrap(); let before = app.session.active().unwrap().history.undo.len(); + let width = app.session.active().unwrap().doc.node(path).and_then(|n| n.appearance.stroke()).unwrap().width; ask(&mut app, json!({"name": name}), true); answer::(&mut app, choice, pump); assert_eq!(open_question(&app), None); assert_eq!(app.session.active().unwrap().history.undo.len(), before + usize::from(choice.is_some())); let stroke = app.session.active().unwrap().doc.node(path).and_then(|n| n.appearance.stroke()).unwrap(); assert_eq!(stroke.brush.as_deref(), choice.is_none().then_some(name)); - assert!(stroke.width > 0.0); + assert_eq!(stroke.width, width, "the stroke keeps its width"); } } diff --git a/crates/ui-egui/src/dialogs/color_balance.rs b/crates/ui-egui/src/dialogs/color_balance.rs index 8c64b06a80..110c124717 100644 --- a/crates/ui-egui/src/dialogs/color_balance.rs +++ b/crates/ui-egui/src/dialogs/color_balance.rs @@ -437,8 +437,8 @@ mod tests { confirm(&mut app, &ctx); assert!(!app.session.in_interaction()); assert_eq!(app.session.doc().unwrap().history.undo.len(), undo + 1); - let lighter = vectorcraft_color::Color::from_hex(&fill_hex(&app, id)).unwrap().to_rgb()[0]; - assert!(lighter > 0.6, "{lighter}"); + // #808080 holds less than 50% black, so taking 50% away leaves none. + assert_eq!(fill_hex(&app, id), "#ffffff"); } #[test] diff --git a/crates/ui-egui/src/panels/doc_info.rs b/crates/ui-egui/src/panels/doc_info.rs index 5cb45f666a..13749667b9 100644 --- a/crates/ui-egui/src/panels/doc_info.rs +++ b/crates/ui-egui/src/panels/doc_info.rs @@ -950,7 +950,7 @@ mod tests { app.canvas.doc_info.clone().unwrap().1 }; let all = shown(&mut app, ""); - assert!(all["pathArea"].as_f64().is_some_and(|a| a > 0.0), "{}", all["pathArea"]); + assert!(all["pathArea"].as_f64().is_some_and(|a| (a - 200.0).abs() < 1e-6), "{}", all["pathArea"]); assert!(Arc::ptr_eq(&all, &shown(&mut app, "objects")), "Objects reuses All Categories' result"); for category in ["document", "fonts"] { let other = shown(&mut app, category); diff --git a/crates/ui-egui/src/panels/tests_blend.rs b/crates/ui-egui/src/panels/tests_blend.rs index 6aeaaeda67..1653488b5a 100644 --- a/crates/ui-egui/src/panels/tests_blend.rs +++ b/crates/ui-egui/src/panels/tests_blend.rs @@ -217,10 +217,10 @@ fn ramp_and_shift_edit_every_selected_blend_and_keep_their_other_options() { assert_eq!(undo_depth(&p.app()), depth + 1, "one undo step for both blends"); // The value typed goes to both; each keeps its own spacing, type and the other value. if name == "Ramp:" { - assert!(after_a.ease.ramp > 0.0 && after_a.ease.ramp == after_b.ease.ramp, "{after_a:?} {after_b:?}"); + assert!((after_a.ease.ramp - 0.75).abs() < 1e-9 && (after_b.ease.ramp - 0.75).abs() < 1e-9, "{after_a:?} {after_b:?}"); assert_eq!((after_a.color_shift, after_b.color_shift), (before_a.color_shift, before_b.color_shift)); } else { - assert!(after_a.color_shift > 0.0 && after_a.color_shift == after_b.color_shift, "{after_a:?} {after_b:?}"); + assert_eq!((after_a.color_shift, after_b.color_shift), (75.0, 75.0), "{after_a:?} {after_b:?}"); assert_eq!((after_a.ease.ramp, after_b.ease.ramp), (before_a.ease.ramp, before_b.ease.ramp)); } assert_eq!((after_a.spacing, after_b.spacing), (BlendSpacing::Steps(3), BlendSpacing::Distance(12.0))); @@ -238,7 +238,7 @@ fn ramp_is_dimmed_while_a_selected_blend_has_no_spine() { assert!(!p.enabled("Ramp:") && p.enabled("Shift:")); p.type_into("Shift:", "75"); let app = p.app(); - assert!(spec(&app, a).color_shift > 0.0 && spec(&app, b).color_shift == spec(&app, a).color_shift); + assert_eq!((spec(&app, a).color_shift, spec(&app, b).color_shift), (75.0, 75.0)); } #[test] diff --git a/crates/ui-egui/src/panels/tests_color_wheel_hex.rs b/crates/ui-egui/src/panels/tests_color_wheel_hex.rs index e2c5a62b80..5c1920d8c4 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_hex.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_hex.rs @@ -452,7 +452,7 @@ fn an_opacity_click_in_one_frame_keeps_its_opacity_over_a_typed_alpha() { quick_click(&mut p, rail.rect.center()); let (hex, opacity) = first_stop(&p); assert_eq!(hex, "#336699", "the text applies"); - assert!(opacity > 0.2 && opacity < 0.8, "the press sets the opacity: {opacity}"); + assert!((opacity - 0.5).abs() < 0.005, "the press sets the opacity: {opacity}"); } /// A press on the opacity slider that takes the focus from an edited field applies the text and diff --git a/crates/ui-egui/src/panels/tests_color_wheel_opacity.rs b/crates/ui-egui/src/panels/tests_color_wheel_opacity.rs index 507b8280e2..f3b5ca6a47 100644 --- a/crates/ui-egui/src/panels/tests_color_wheel_opacity.rs +++ b/crates/ui-egui/src/panels/tests_color_wheel_opacity.rs @@ -94,7 +94,7 @@ fn the_row_shows_under_the_box_view() { let at = along(&slider(&p), 0.5); p.fx.click_at(at).idle(2); let o = fill_opacity(&p.app()); - assert!((o - 0.5).abs() < 0.05, "{o}"); + assert!((o - 0.5).abs() < 0.005, "{o}"); } /// A value this build does not read keeps the rest of the preferences and reads as the default. @@ -122,7 +122,7 @@ fn the_slider_sets_the_fill_opacity_and_takes_the_arrow_keys() { let at = along(&slider(&p), 0.5); p.fx.click_at(at).idle(2); let o = fill_opacity(&p.app()); - assert!((o - 0.5).abs() < 0.05, "{o}"); + assert!((o - 0.5).abs() < 0.005, "{o}"); let labels = undo_labels(&p.app()); assert_eq!((labels.len(), labels.last().map(String::as_str)), (undo + 1, Some("Opacity"))); assert_eq!(crate::panels::current_paints(&p.app()).0.color().unwrap().to_hex(), "#ff0000"); diff --git a/crates/ui-egui/src/tests/plugins.rs b/crates/ui-egui/src/tests/plugins.rs index 6dc9853a2a..351efaec28 100644 --- a/crates/ui-egui/src/tests/plugins.rs +++ b/crates/ui-egui/src/tests/plugins.rs @@ -215,8 +215,10 @@ fn filter_dialog_previews_and_commits_one_undo_step() { set_field(&mut h, "amount", json!(50)).unwrap(); step(&mut h); assert!(h.state().session.in_interaction(), "previewing"); - let [r, g, _] = fill_rgb(h.state(), id); - assert!(r < 1.0 && g > 0.0, "half desaturated on the canvas: {r} {g}"); + let [r, g, b] = fill_rgb(h.state(), id); + for (got, want) in [(r, 0.6063), (g, 0.1063), (b, 0.1063)] { + assert!((got - want).abs() < 1e-4, "half desaturated on the canvas: {r} {g} {b}"); + } step(&mut h); let (shown, _) = h.state().canvas.shown.as_ref().expect("a rendered canvas frame"); let shown_fill = shown.node(id).unwrap().appearance.fill_paint().color().unwrap().to_rgb_uncalibrated(); From c52314a75a9554e0de1ac4fdaca3f7d3c5593c55 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Tue, 1 Dec 2026 04:11:45 -0800 Subject: [PATCH 11/11] Library panels: build browser rows once per library, not every frame A library panel rebuilt every browser row, with its tooltip and name index, on each frame, and the browser's memo key hashed every row each frame. With a swatch library of thousands of swatches, scrolling the thumbnail grid spent most of each frame on that work. The panel now keeps the rows it built for the library contents it shows and the UI language, and builds them again only when either changes. The memo key names that build instead of hashing the rows. Rows of panels that have closed are dropped when rows are next built. Pattern sources no longer copy every swatch name to find the few patterns. --- crates/ui-egui/src/panels/brushes.rs | 3 + crates/ui-egui/src/panels/graphic_styles.rs | 3 + crates/ui-egui/src/panels/library_panel.rs | 88 +++++++++++++++---- .../ui-egui/src/panels/library_panel/tests.rs | 24 +++++ .../ui-egui/src/panels/swatches/libraries.rs | 5 +- crates/ui-egui/src/panels/symbols.rs | 4 + 6 files changed, 109 insertions(+), 18 deletions(-) diff --git a/crates/ui-egui/src/panels/brushes.rs b/crates/ui-egui/src/panels/brushes.rs index d8075d4c66..aaccca637b 100644 --- a/crates/ui-egui/src/panels/brushes.rs +++ b/crates/ui-egui/src/panels/brushes.rs @@ -884,6 +884,9 @@ impl LibraryKind for BrushLibraries { fn path(app: &VectorcraftApp, id: &str) -> Option { app.session.brush_libraries.path(id).map(str::to_string) } + fn same(a: &Self::Lib, b: &Self::Lib) -> bool { + Rc::ptr_eq(a, b) + } fn rows<'a>(lib: &'a Self::Lib, _id: &str) -> Vec> { lib.iter().map(|b| Row { name: b.name(), item: Some(b) }).collect() } diff --git a/crates/ui-egui/src/panels/graphic_styles.rs b/crates/ui-egui/src/panels/graphic_styles.rs index d9250ad7ee..e6668323a8 100644 --- a/crates/ui-egui/src/panels/graphic_styles.rs +++ b/crates/ui-egui/src/panels/graphic_styles.rs @@ -1004,6 +1004,9 @@ impl LibraryKind for GraphicStyleLibraries { fn path(app: &VectorcraftApp, id: &str) -> Option { app.session.style_libraries.path(id).map(str::to_string) } + fn same(a: &Self::Lib, b: &Self::Lib) -> bool { + Arc::ptr_eq(a, b) + } fn rows<'a>(lib: &'a Self::Lib, _id: &str) -> Vec> { lib.iter().map(|s| Row { name: &s.style().name, item: Some(s) }).collect() } diff --git a/crates/ui-egui/src/panels/library_panel.rs b/crates/ui-egui/src/panels/library_panel.rs index e9fc506ec0..529671ccce 100644 --- a/crates/ui-egui/src/panels/library_panel.rs +++ b/crates/ui-egui/src/panels/library_panel.rs @@ -15,9 +15,11 @@ //! Library… (`ui.libraryPanel.locate`). The find text is the browser's; the selection is panel state //! (`UiState::library_selection`). +use std::any::Any; use std::borrow::Cow; -use std::cell::RefCell; +use std::cell::{Cell, RefCell}; use std::collections::HashMap; +use std::rc::Rc; use craft::behavior::{IconId, Selection, SelectionModel}; use craft::host::PickRequest; @@ -25,9 +27,7 @@ use craft::theme::variant::Tone; use craft::ui::contract::{Bind, MemoKey, MemoProps, SelectMode, Show as _, ShowContainer as _, Trigger}; use craft::ui::menu::{Menu, MenuItem, PanelRow}; use craft::ui::notices::{Notice, NoticeAction, NoticeLayout}; -use craft::ui::patterns::presets::{ - PresetBrowser, PresetEvent, PresetFns, PresetKind, PresetRow, PresetRowMenu, PresetSource, PresetState, PresetView, -}; +use craft::ui::patterns::presets::{PresetBrowser, PresetEvent, PresetFns, PresetRow, PresetRowMenu, PresetSource, PresetState, PresetView}; use craft::ui::primitives::{ContentPainterCx, IconSpec}; use craft::ui::runtime::access::PopupKind; use craft::ui::runtime::commands::{CommandRef, CommandState, CommandStates}; @@ -122,7 +122,7 @@ pub(crate) trait LibraryKind { /// The view a panel shows until another is picked. const VIEW: View = View::MediumThumb; /// A library's contents, cheap to clone. - type Lib; + type Lib: Clone + 'static; type Item: Sync; /// What the thumbnails paint with besides each item (a panel setting, the documents a library's patterns come /// from); `()` for nothing. @@ -135,6 +135,9 @@ pub(crate) trait LibraryKind { fn find(app: &VectorcraftApp, key: &str) -> Found; /// The file library `id` was read from, if any. fn path(app: &VectorcraftApp, id: &str) -> Option; + /// Whether `a` and `b` are the same contents, not only equal ones: the panel reuses the browser rows it built for + /// `a` while [`get`](Self::get) returns `b`. + fn same(a: &Self::Lib, b: &Self::Lib) -> bool; /// The rows of library `id`; the browser's search filters what it shows (by the shown name and /// [`PresetRow::search_name`]). fn rows<'a>(lib: &'a Self::Lib, id: &str) -> Vec>; @@ -608,6 +611,7 @@ fn saved_view(view: PresetView, zoom: f64) -> View { /// The browser rows of library `id`'s `rows`, flat: a folder is a row of its own before its items, which a click /// selects as it selects an item (production's folder tiles neither opened nor closed). fn browser_rows(panel: &str, id: &str, rows: &[Row]) -> Vec> { + BUILDS.with(|n| n.set(n.get() + 1)); rows.iter() .map(|r| { let label = K::label(id, r.name); @@ -624,22 +628,73 @@ fn browser_rows(panel: &str, id: &str, rows: &[Row]) -> .collect() } +/// A library panel's browser rows, built for one library's contents in one UI language. +struct BuiltRows { + /// The contents the rows were built from, held so that [`LibraryKind::same`] does not match other contents + /// later stored at the same address. + lib: L, + lang: crate::i18n::Lang, + /// Different for every build, so the browser's memo key changes with the rows. + build: u64, + rows: Rc>>, + /// Each item row's position in [`LibraryKind::rows`], by stored name. + items: Rc>, +} + +thread_local! { + /// Each library panel's [`BuiltRows`], by panel id. + static BUILT_ROWS: RefCell>> = RefCell::new(HashMap::new()); + /// How many times [`browser_rows`] has run, for tests. + static BUILDS: Cell = const { Cell::new(0) }; +} + +/// How many times the panels have built browser rows on this thread. +#[cfg(test)] +pub(crate) fn row_builds() -> u64 { + BUILDS.with(Cell::get) +} + +/// [`BuiltRows::build`], [`BuiltRows::rows`] and [`BuiltRows::items`]. +type Built = (u64, Rc>>, Rc>); + +/// Panel `panel`'s browser rows of `lib`: the ones built before while the panel shows the same contents in the same +/// language, otherwise built now. Building drops the rows of the panels that are no longer open in `ui`. +fn built_rows(ui: &UiState, panel: &str, id: &str, lib: &K::Lib) -> Built { + let lang = crate::i18n::current(); + BUILT_ROWS.with(|cache| { + let mut cache = cache.borrow_mut(); + if let Some(b) = cache.get(panel).and_then(|b| b.downcast_ref::>()) + && b.lang == lang + && K::same(&b.lib, lib) + { + return (b.build, b.rows.clone(), b.items.clone()); + } + let flat = K::rows(lib, id); + let rows = Rc::new(browser_rows::(panel, id, &flat)); + let items = Rc::new(flat.iter().enumerate().filter(|(_, r)| r.item.is_some()).map(|(i, r)| (r.name.to_string(), i)).collect()); + let build = BUILDS.with(Cell::get); + let built = BuiltRows { lib: lib.clone(), lang, build, rows: rows.clone(), items: Rc::clone(&items) }; + cache.retain(|p, _| is_open(ui, p)); + cache.insert(panel.to_string(), Box::new(built)); + (build, rows, items) + }) +} + /// What a library's browser shows: its rows, the items their thumbnails paint and what those paint with. struct Shown<'a, K: LibraryKind> { + /// [`BuiltRows::build`] of `rows`. + build: u64, rows: &'a [PresetRow], - items: HashMap<&'a str, &'a K::Item>, + flat: &'a [Row<'a, K::Item>], + items: &'a HashMap, thumbs: K::Thumbs, } -/// By the rows (each names its library and item, whose look a library keeps) and what the thumbnails paint with. +/// By the build of the rows (each names its library and item, whose look a library keeps) and what the thumbnails +/// paint with. impl MemoProps for Shown<'_, K> { fn key(&self, key: &mut MemoKey) { - for row in self.rows { - row.key.key(key); - row.label.key(key); - row.depth.key(key); - (row.kind == PresetKind::Item).key(key); - } + self.build.key(key); self.rows.len().key(key); self.thumbs.key(key); } @@ -658,15 +713,14 @@ fn body(app: &mut VectorcraftApp, ui: &mut Ui, id: &str) { }; let panel = panel_id(K::KIND, id); let (view, hide_find) = settings(&app.ui, K::KIND, id).map_or((K::VIEW, false), |s| (s.view.unwrap_or(K::VIEW), s.hide_find)); + let (build, rows, items) = built_rows::(&app.ui, &panel, id, &lib); let flat = K::rows(&lib, id); - let rows = browser_rows::(&panel, id, &flat); - let items = flat.iter().filter_map(|r| r.item.map(|i| (r.name, i))).collect(); let fns = PresetFns::new(|shown: &Shown<'_, K>, _| shown.rows.to_vec()).thumb(|shown, cx, rect, info| { - if let Some(item) = shown.items.get(info.key.name.as_str()) { + if let Some(item) = shown.items.get(info.key.name.as_str()).and_then(|&i| shown.flat.get(i)).and_then(|r| r.item) { K::thumb(&shown.thumbs, cx, rect, item); } }); - let source = PresetSource::new(Shown:: { rows: &rows, items, thumbs: K::thumbs(app, &lib) }, fns); + let source = PresetSource::new(Shown:: { build, rows: &rows, flat: &flat, items: &items, thumbs: K::thumbs(app, &lib) }, fns); let selection = selected(app, &panel); // The search text and the open groups are the browser's; the view is the panel's setting. let state_id = egui::Id::unique(("library-panel-state", &panel)); diff --git a/crates/ui-egui/src/panels/library_panel/tests.rs b/crates/ui-egui/src/panels/library_panel/tests.rs index a08ea664f8..679bd5f983 100644 --- a/crates/ui-egui/src/panels/library_panel/tests.rs +++ b/crates/ui-egui/src/panels/library_panel/tests.rs @@ -786,3 +786,27 @@ fn built_in_library_swatches_are_listed_in_the_ui_language() { assert!(app.session.doc().unwrap().doc.swatch("Clay 1").is_some(), "added under its own name"); crate::i18n::set_current(crate::i18n::Lang::EN); } + +/// A library panel builds its browser rows once for the library it shows, not on every frame, and builds them again +/// when the UI language changes the names it lists. +#[test] +fn library_panel_builds_its_rows_once_per_library_and_language() { + let mut app = app(); + let ctx = context(); + app.run("window.swatchLibrary", json!({"library": "earth-tones"})).unwrap(); + let panel = shown(&app); + app.run("ui.libraryPanel", json!({"panel": panel, "view": "smallList"})).unwrap(); + let draw = |app: &mut VectorcraftApp, ui: &mut Ui| show(app, ui, &panel); + let before = row_builds(); + for _ in 0..4 { + draw_frame(&mut app, &ctx, &draw, vec![]); + } + assert_eq!(row_builds() - before, 1, "four frames of an unchanged library build its rows once"); + crate::i18n::set_current(crate::i18n::Lang::from_code("fr").expect("fr registered")); + draw_frame(&mut app, &ctx, &draw, vec![]); + let out = draw_frame(&mut app, &ctx, &draw, vec![]); + crate::i18n::set_current(crate::i18n::Lang::EN); + assert_eq!(row_builds() - before, 2, "a new UI language builds the rows again, once"); + let painted = crate::tests_labels::shapes_text(&out); + assert!(painted.lines().any(|l| l == "Argile 1"), "the rebuilt rows are in the new language: {painted}"); +} diff --git a/crates/ui-egui/src/panels/swatches/libraries.rs b/crates/ui-egui/src/panels/swatches/libraries.rs index 4f16980b9a..c14d6cb040 100644 --- a/crates/ui-egui/src/panels/swatches/libraries.rs +++ b/crates/ui-egui/src/panels/swatches/libraries.rs @@ -106,6 +106,9 @@ impl LibraryKind for SwatchLibraries { fn path(app: &VectorcraftApp, id: &str) -> Option { app.session.swatch_libraries.path(id).map(str::to_string) } + fn same(a: &Self::Lib, b: &Self::Lib) -> bool { + Arc::ptr_eq(a, b) + } /// Ungrouped swatches, then each colour group's folder and swatches, as in the Swatches panel; the browser's Find /// narrows them. fn rows<'a>(lib: &'a Self::Lib, _id: &str) -> Vec> { @@ -135,7 +138,7 @@ impl LibraryKind for SwatchLibraries { row } fn thumbs(app: &VectorcraftApp, lib: &Self::Lib) -> PatternSources { - PatternSources(lib.iter().filter_map(|w| Some((w.name.clone(), swatchlib::pattern_source(&app.session, w)?))).collect()) + PatternSources(lib.iter().filter_map(|w| swatchlib::pattern_source(&app.session, w).map(|d| (w.name.clone(), d))).collect()) } /// A pattern library's pattern, or a loaded library's, drawn from the library. fn thumb(sources: &PatternSources, cx: &ContentPainterCx<'_>, rect: Rect, w: &Swatch) { diff --git a/crates/ui-egui/src/panels/symbols.rs b/crates/ui-egui/src/panels/symbols.rs index e8dbf1a468..cfa24aadec 100644 --- a/crates/ui-egui/src/panels/symbols.rs +++ b/crates/ui-egui/src/panels/symbols.rs @@ -976,6 +976,10 @@ impl LibraryKind for SymbolLibraries { fn path(app: &VectorcraftApp, id: &str) -> Option { app.session.symbol_libraries.path(id).map(str::to_string) } + /// [`get`](LibraryKind::get) wraps the library anew each time: by the library the symbols are in. + fn same(a: &Self::Lib, b: &Self::Lib) -> bool { + a.len() == b.len() && a.first().zip(b.first()).is_none_or(|(a, b)| Arc::ptr_eq(&a.lib, &b.lib)) + } fn rows<'a>(lib: &'a Self::Lib, _id: &str) -> Vec> { lib.iter().map(|s| Row { name: s.name(), item: Some(s) }).collect() }