VectorCraft: An open-source, vector art tool written by scratch in pure Rust
Freehand Tool Options: Accurate/Smooth ends on the Fidelity slider, Spanish rows (review of #390)
bflatastic505f3bd7ae46
diff --git a/ROADMAP.md b/ROADMAP.mdindex a214ce38c..cc9972d54 100644--- a/ROADMAP.md+++ b/ROADMAP.md@@ -191,7 +191,7 @@ about 1–1.5 agent-hours each, so the other rows (estimated on the older scale)| Area | Weight | Done | Missing (main items) | One agent (h) ||---|---:|---:|---|---:|| Selection, transform & align tools | 6 | 85% | Free Transform/Scale/Reflect along a rotated box, Start Global Edit, transform nuances (the rotated persistent bounding box is done) | 4–6 |-| Drawing tools | 7 | 85% | Shaper Groups (merge/punch overlapping shapes), pencil and the remaining pen modifier nuances, Touch Type, Live Corners on plain paths and polygons (and Relative rounding) | 10–15 |+| Drawing tools | 7 | 85% | Shaper Groups (merge/punch overlapping shapes), pencil and the remaining pen modifier nuances, the freehand Tool Options' Keep selected, Alt to the Smooth tool, Blob Brush Merge Only with Selection and brush angle/roundness, Touch Type, Live Corners on plain paths and polygons (and Relative rounding) | 10–15 || Path operations, Pathfinder, Shape Builder, Live Paint | 5 | 86% | Live Paint gap options, Shape Builder gap detection and options | 3–6 || Colour, swatches, gradients, patterns, mesh, recolor | 7 | 96% | freeform and mixed spot/process gradients in SVG/PDF (exported as stops or process colours), pattern fills in Expand | 2–4 || Strokes, brushes, width profiles | 5 | 88% | brush options depth, brush libraries (generated in code), brushes driven by pen tilt, bearing and barrel rotation (6D art pens) | 12–20 |diff --git a/crates/ui-egui/src/dialogs/color_guide_options.rs b/crates/ui-egui/src/dialogs/color_guide_options.rsindex 9e61ec57e..faeb11e0d 100644--- a/crates/ui-egui/src/dialogs/color_guide_options.rs+++ b/crates/ui-egui/src/dialogs/color_guide_options.rs@@ -41,13 +41,7 @@ fn body(app: &mut VectorcraftApp, ui: &mut egui::Ui, d: &mut Dialog) -> bool {};form::slider(ui, d, "steps", tl!("Steps:"), 1.0..=max, "", &ramp);form::slider(ui, d, "amount", tl!("Variation:"), 0.0..=100.0, "%", &ramp);- ui.horizontal(|ui| {- ui.add_space(form::SLIDER_LABEL + ui.spacing().item_spacing.x);- let (r, _) = ui.allocate_exact_size(vec2(form::SLIDER_WIDTH, 14.0), Sense::hover());- let font = egui::FontId::proportional(11.0);- ui.painter().text(r.left_center(), egui::Align2::LEFT_CENTER, tl!("Less"), font.clone(), t.text_dim);- ui.painter().text(r.right_center(), egui::Align2::RIGHT_CENTER, tl!("More"), font, t.text_dim);- });+ form::slider_ends(ui, form::SLIDER_LABEL, (tl!("Less"), tl!("More")));ui.add_space(10.0);// Preview: the base colour's row of variations.let o = options(app, d);diff --git a/crates/ui-egui/src/dialogs/form.rs b/crates/ui-egui/src/dialogs/form.rsindex c973b4675..6bf8d75b9 100644--- a/crates/ui-egui/src/dialogs/form.rs+++ b/crates/ui-egui/src/dialogs/form.rs@@ -329,6 +329,19 @@ pub(super) fn slider_w(}}+/// The words at the two ends of a slider's rail (Less … More), under a slider whose label column+/// is `label_w` wide.+pub(super) fn slider_ends(ui: &mut egui::Ui, label_w: f32, (left, right): (&str, &str)) {+ let t = Tokens::get(ui.ctx());+ ui.horizontal(|ui| {+ ui.add_space(label_w + ui.spacing().item_spacing.x);+ let (r, _) = ui.allocate_exact_size(egui::vec2(SLIDER_WIDTH, 14.0), egui::Sense::hover());+ let font = egui::FontId::proportional(11.0);+ ui.painter().text(r.left_center(), egui::Align2::LEFT_CENTER, left, font.clone(), t.text_dim);+ ui.painter().text(r.right_center(), egui::Align2::RIGHT_CENTER, right, font, t.text_dim);+ });+}+/// The field where [`preview`] keeps the parameters it last previewed.pub(super) const PREVIEWED: &str = "__previewed";diff --git a/crates/ui-egui/src/dialogs/freehand.rs b/crates/ui-egui/src/dialogs/freehand.rsindex 3f8628b8b..8a6fd1889 100644--- a/crates/ui-egui/src/dialogs/freehand.rs+++ b/crates/ui-egui/src/dialogs/freehand.rs@@ -80,6 +80,7 @@ fn fidelity(ui: &mut egui::Ui, d: &mut Dialog) {if let Some(n) = new.filter(|n| *n != v) {d.fields.insert("fidelity".into(), json!(n));}+ form::slider_ends(ui, label_w, (tl!("Accurate"), tl!("Smooth")));ui.label(egui::RichText::new(tl!("A lower value follows the stroke closely; a higher one gives fewer points and smoother curves.")).size(11.5)@@ -136,7 +137,15 @@ mod tests {// Pencil: Fidelity, fill, the two tolerances; no Size.app.run("tool.options", json!({"tool": "pencil"})).unwrap();let text = painted(&mut app);- for label in ["Pencil Tool Options", "Fidelity:", "Fill new strokes", "Close paths when ends are within:", "Edit selected paths within:"] {+ for label in [+ "Pencil Tool Options",+ "Fidelity:",+ "Accurate",+ "Smooth",+ "Fill new strokes",+ "Close paths when ends are within:",+ "Edit selected paths within:",+ ] {assert!(text.contains(label), "{label} in {text}");}assert!(!text.contains("Size:"), "{text}");diff --git a/crates/ui-egui/src/i18n/es.tsv b/crates/ui-egui/src/i18n/es.tsvindex 7e66f6f0f..1bb213d42 100644--- a/crates/ui-egui/src/i18n/es.tsv+++ b/crates/ui-egui/src/i18n/es.tsv@@ -36,11 +36,13 @@[Default] is protected: New… starts an editable copy. [Predeterminado] está protegido: Nuevo… crea una copia editable.[Unnamed] [Sin nombre]A File… Un archivo…+ A lower value follows the stroke closely; a higher one gives fewer points and smoother curves. Un valor menor sigue el trazo de cerca; uno mayor da menos puntos y curvas más suaves.A new preset starting from the selected one Un preajuste nuevo a partir del seleccionadoA saved copy of the selected preset Una copia guardada del preajuste seleccionadoAbout VectorCraft Acerca de VectorCraftabove arribaAbsolute Position Posición absoluta+ Accurate PrecisoAbutting ContiguoAction {n} Acción {n}Actions Acciones@@ -347,6 +349,7 @@Close All Cerrar todoClose Library Cerrar bibliotecaClose Path Cerrar trazado+ Close paths when ends are within: Cerrar trazados cuando los extremos estén a menos de:Cmd CmdCMYK CMYKCMYK Color Color CMYK@@ -726,6 +729,7 @@Edit Pattern Editar motivoEdit PDF Preset Editar preajuste de PDFEdit Print Preset Editar preajuste de impresión+ Edit selected paths within: Editar trazados seleccionados a menos de:Edit Selection Editar selecciónEdit Selection… Editar selección…Edit Symbol Editar símbolo@@ -892,6 +896,7 @@Fill & Stroke Relleno y trazoFill (X), double-click for the Color Picker Relleno (X), doble clic para el selector de colorFill and Stroke Relleno y trazo+ Fill new strokes Rellenar trazos nuevosFill Color Color de rellenoFill New Type Objects With Placeholder Text Rellenar nuevos objetos de texto con texto de muestraFill Rule Regla de rellenodiff --git a/crates/ui-egui/src/i18n/ja.tsv b/crates/ui-egui/src/i18n/ja.tsvindex 156f0108a..94ed136c8 100644--- a/crates/ui-egui/src/i18n/ja.tsv+++ b/crates/ui-egui/src/i18n/ja.tsv@@ -664,6 +664,7 @@A new preset starting from the selected one 選択したプリセットをもとにした新しいプリセットA saved copy of the selected preset 選択したプリセットの保存済みの複製Absolute Position 絶対位置+ Accurate 精細Abutting 隣接Activate Document ドキュメントをアクティブにするActive Perspective Plane アクティブな遠近面diff --git a/crates/ui-egui/src/i18n/pt-br.tsv b/crates/ui-egui/src/i18n/pt-br.tsvindex 59e4b424e..4b24fd407 100644--- a/crates/ui-egui/src/i18n/pt-br.tsv+++ b/crates/ui-egui/src/i18n/pt-br.tsv@@ -104,6 +104,7 @@A saved copy of the selected preset Uma cópia salva do predefinido selecionadoAbout VectorCraft Sobre o VectorCraftAbsolute Position Posição Absoluta+ Accurate PrecisoAbutting ContíguoActions AçõesActivate Document Ativar Documentodiff --git a/crates/ui-egui/src/i18n/zh-hans.tsv b/crates/ui-egui/src/i18n/zh-hans.tsvindex 2335e05ee..97d351229 100644--- a/crates/ui-egui/src/i18n/zh-hans.tsv+++ b/crates/ui-egui/src/i18n/zh-hans.tsv@@ -46,6 +46,7 @@About VectorCraft 关于 VectorCraftabove 以上Absolute Position 绝对位置+ Accurate 精确Abutting 相邻Action {n} 动作 {n}Actions 动作diff --git a/crates/ui-egui/src/i18n/zh-hant.tsv b/crates/ui-egui/src/i18n/zh-hant.tsvindex 6ad02831a..cbe191d28 100644--- a/crates/ui-egui/src/i18n/zh-hant.tsv+++ b/crates/ui-egui/src/i18n/zh-hant.tsv@@ -54,6 +54,7 @@About VectorCraft 關於 VectorCraftabove 以上Absolute Position 絕對位置+ Accurate 精確Abutting 相鄰Action {n} 動作 {n}Actions 動作