Recolor Artwork: new comments use American spelling

The comments added with the Add Color and Remove Color tools spell color the American way, and the test comment for the second Add Color click describes the click the test makes.
This commit is contained in:
dotCooCoo
2026-11-14 22:25:40 -08:00
parent 42fab2ea2a
commit 3d42ae6d30
4 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -1226,7 +1226,7 @@ impl GroupEdit {
}
/// Rewrite colour group `group` with `colors`: its swatches take them in order (keeping their
/// names, kinds and global or spot flags), a `None` removes the swatch at its place, extra colours
/// names, kinds and global or spot flags), a `None` removes the swatch at its place, extra colors
/// are added as new swatches and swatches past the end are removed. Paints linked to its global
/// swatches follow (a removed swatch's are unlinked); `rename` renames the group. A built-in swatch
/// (None, Registration) it would change or remove is refused.
@@ -1249,7 +1249,7 @@ pub(super) fn rewrite_group(d: &mut Document, group: &str, colors: &[Option<Colo
let mut relinks = vec![];
let old = std::mem::take(&mut d.swatch_groups[gi].swatches);
let old_len = old.len();
// The swatches that stay, each with its new colour.
// The swatches that stay, each with its new color.
let mut kept: Vec<(Swatch, Color)> = vec![];
for (i, w) in old.into_iter().enumerate() {
match colors.get(i).copied().flatten() {
+3 -3
View File
@@ -575,9 +575,9 @@ fn selection(d: &Dialog) -> Vec<usize> {
}
/// `recolor.apply` parameters: the rows, method, library and the group with its new name and
/// colours: the new colours of the rows with current colours, each in its swatch's place (`null`
/// for a row whose new colour was removed, which removes its swatch), then (with art) the group's
/// colours no row took, then the colours added on the Edit tab.
/// colors: the new colors of the rows with current colors, each in its swatch's place (`null`
/// for a row whose new color was removed, which removes its swatch), then (with art) the group's
/// colors no row took, then the colors added on the Edit tab.
fn apply_params(d: &Dialog) -> Value {
let rs = rows(d);
let group = d.fields.get("group").and_then(Value::as_str).map(|g| {
+1 -1
View File
@@ -1207,7 +1207,7 @@ fn the_add_color_tool_adds_a_row_with_no_current_colors() {
assert!((hue - 120.0).abs() < 1.0 && (s - 0.5).abs() < 0.01 && (b - v).abs() < 0.01, "{:?}", [hue, s, b]);
assert_eq!(field(h.state(), "__sel"), json!([2]), "the new color is selected");
assert_eq!(fills(h.state()), fills_before, "a color with no current colors recolors no art");
// A click on the new marker adds another color; the tool stays on.
// A second click adds another color; the tool stays on.
let next = wheel_at(&h, 240.0, 0.75);
h.input_mut().events.extend(press(next, 1));
h.run_steps(3);
+1 -1
View File
@@ -923,7 +923,7 @@ pub struct WheelResponse {
/// A colour moved by dragging its marker (a new hue and saturation) or, the selected colour,
/// the brightness slider (a new brightness): `[h°, s, v]`, `None` where the control kept it.
pub moved: Option<(usize, [Option<f32>; 3])>,
/// A click on the wheel: the colour whose marker is within reach of it (if any), and the hue
/// A click on the wheel: the color whose marker is within reach of it (if any), and the hue
/// (degrees) and saturation under the pointer (1 for a marker past the wheel's edge).
pub clicked: Option<(Option<usize>, [f32; 2])>,
}