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.
This commit is contained in:
dotCooCoo committed 2026-11-19 19:38:52 -08:00
1 parent d38e414b77
commit 64211808de
41 files changed
+672 -10

No files matched your search

+1
View File
@@ -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.
+12
View File
@@ -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",
+1
View File
@@ -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;
+6 -1
View File
@@ -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`.
@@ -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
}
+2
View File
@@ -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 Нулиране на позицията на лентата с инструменти
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it contains an unexpected character in line 2 and column 73.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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ů
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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 Επαναφορά θέσης γραμμής εργαλείων
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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 ટૂલબાર સ્થિતિ રીસેટ કરો
Can't render this file because it contains an unexpected character in line 72 and column 5.
+2
View File
@@ -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 टूलबार स्थिति रीसेट करें
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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 ツールバーの位置をリセット
Can't render this file because it is too large.
+2
View File
@@ -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 ხელსაწყოთა ზოლის პოზიციის ჩამოყრა
Can't render this file because it is too large.
+2
View File
@@ -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 도구 모음 위치 재설정
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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 Сбросить положение панели инструментов
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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
Can't render this file because it is too large.
+2
View File
@@ -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 Скинути положення панелі інструментів
Can't render this file because it is too large.
+2
View File
@@ -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ụ
Can't render this file because it is too large.
+2
View File
@@ -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 重置工具栏位置
Can't render this file because it is too large.
+2
View File
@@ -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 重設工具列位置
Can't render this file because it is too large.
+33
View File
@@ -725,6 +725,39 @@ fn run_ui_part6(app: &mut VectorcraftApp, id: &str, p: &Value) -> Option<Result<
Err(e) => 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
+12
View File
@@ -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",
+1 -1
View File
@@ -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![]);
+1
View File
@@ -31,6 +31,7 @@ mod printps;
mod printtiling;
mod puppetwarp;
mod quickpenbar;
mod quickpenwheel;
mod recolor;
mod recovery;
pub(super) mod removeanchors;
+407
View File
@@ -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<Event>) {
frame_at(app, ctx, events, None);
}
/// [`frame`] at input `time` (seconds), when given.
fn frame_at(app: &mut VectorcraftApp, ctx: &egui::Context, events: Vec<Event>, time: Option<f64>) {
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<SubPath> {
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));
}
+15 -6
View File
@@ -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`,
+1 -1
View File
@@ -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.
+1 -1
View File
@@ -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` |