From e8068cb1e0f97edff899d1f3a8b29cf3228d2e79 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 30 Nov 2026 22:33:57 -0800 Subject: [PATCH] Gradient: comments in the stop popover code use American spelling --- crates/ui-egui/src/dialogs/gradient_stop.rs | 18 +++++++++--------- crates/ui-egui/src/panels.rs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/crates/ui-egui/src/dialogs/gradient_stop.rs b/crates/ui-egui/src/dialogs/gradient_stop.rs index 2f93db108d..3f0cf54d46 100644 --- a/crates/ui-egui/src/dialogs/gradient_stop.rs +++ b/crates/ui-egui/src/dialogs/gradient_stop.rs @@ -276,9 +276,9 @@ fn recolor(mut stops: Vec, i: usize, color: Color, link: Option<(S stops } -/// Solid colours of the document's swatches (groups included), with their names, and the entry the target's colour -/// comes from: a linked colour's tint swatch for that tint, or its global swatch at 100%; an unlinked colour's process -/// swatch of that very colour. Where several entries qualify, `picked`, the swatch last picked in the popover for this +/// Solid colors of the document's swatches (groups included), with their names, and the entry the target's color +/// comes from: a linked color's tint swatch for that tint, or its global swatch at 100%; an unlinked color's process +/// swatch of that very color. Where several entries qualify, `picked`, the swatch last picked in the popover for this /// target, is the one. fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&PickedSwatch>) -> (Vec<(String, Color)>, Option) { let Some(st) = app.session.active() else { return (vec![], None) }; @@ -295,7 +295,7 @@ fn swatch_colors(app: &VectorcraftApp, target: &Target, picked: Option<&PickedSw for swatch in st.doc.swatches_iter() { let is_picked = picked.is_some_and(|p| p.name == swatch.name); let Some(own) = swatch.paint.color() else { continue }; - // Picking this swatch would give the target the colour and link it has now. + // Picking this swatch would give the target the color and link it has now. let source = match (link, swatch.tint_of()) { (Some((base, tint)), Some((of, own_tint))) => of == base && same_tint(tint, own_tint), (Some((base, tint)), None) => swatch.global && swatch.name == base && same_tint(tint, 1.0), @@ -362,7 +362,7 @@ struct Feed { /// Percent: the stop's location or the point's spread. amount: f64, swatches: Vec<(String, Color)>, - /// The entry of `swatches` the target's colour comes from. + /// The entry of `swatches` the target's color comes from. selected_swatch: Option, /// Picking the displayed swatch changes at least one edited paint. displayed_swatch_changes_paints: bool, @@ -573,8 +573,8 @@ fn swatches(ui: &mut Ui, feed: &Feed, filed: &mut Filed) { Notice::new(Tone::Info, tl!("The document has no colour swatches.").to_owned()).show(ui); return; } - // Only the entry the target's colour comes from is selected, and none when no entry is: a swatch that only draws - // the same colour, such as a spot ink an unlinked stop has the colour of, is not. + // Only the entry the target's color comes from is selected, and none when no entry is: a swatch that only draws + // the same color, such as a spot ink an unlinked stop has the color of, is not. let shown = SwatchPalette::new("Swatches", Bind::given(feed.current), &feed.tiles).selected_swatch(feed.selected_swatch).select_by_color(false).show(ui); // Every click remembers the pick. The displayed swatch applies only when an edited paint differs at this stop or point. @@ -795,7 +795,7 @@ pub(crate) fn pump(app: &mut VectorcraftApp, ctx: &egui::Context) { if filed.swatch_changes_paints { pick_swatch(app, &target, &name, color); } - // Swatches of one colour draw alike: the Swatches view shows the one picked, not the first of them. + // Swatches of one color draw alike: the Swatches view shows the one picked, not the first of them. let picked = selected(app).and_then(|target| PickedSwatch::of(app, &target, &name)); dialogs.with(|host| { if let Some(popover) = host.get_mut_by_id::(id) { @@ -1018,7 +1018,7 @@ mod tests { let undo = panel.app().session.active().unwrap().history.undo.len(); panel.click("First teal"); assert_eq!(shown_swatch(&mut panel).as_deref(), Some("First teal")); - assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo, "the same colour again is no edit"); + assert_eq!(panel.app().session.active().unwrap().history.undo.len(), undo, "the same color again is no edit"); } #[test] diff --git a/crates/ui-egui/src/panels.rs b/crates/ui-egui/src/panels.rs index 7d9149bf5a..5ac418d81d 100644 --- a/crates/ui-egui/src/panels.rs +++ b/crates/ui-egui/src/panels.rs @@ -1031,7 +1031,7 @@ pub(crate) fn recent_colors(app: &VectorcraftApp, ui: &mut Ui) -> Option .spacing(SwatchSpacing::Spaced) .drag_payload(move |drag: &ListDrag| dragged.get(drag.grabbed).map(|c| PanelDrag::paint(Paint::solid(*c)))) .show(ui); - // The stored colour of the cell clicked, in its own model: colours in two models can draw alike. + // The stored color of the cell clicked, in its own model: colors in two models can draw alike. out.picked_swatch.and_then(|i| stored.get(i).copied()) }