Swatches: linked paints find their swatch in one name map

Add Used Colors, New Color Group from artwork and Select All Unused
looked up each linked paint's swatch by searching every swatch. They now
build one map of swatch names first, with the built-in Registration
swatch, and the first swatch of each name as before.

New tests and test cases: New Color Group from artwork with repeated,
near-equal and -0.0 colors, a Registration link and names that need
numbering, and New Swatch and Edit Color Group with near-equal and
-0.0 colors; each checks the names, their order and one undo step.
This commit is contained in:
dotCooCoo
2026-11-08 13:20:41 +07:00
committed by bflatastic
parent 346f80dcc7
commit cd95a8a6d1
4 changed files with 117 additions and 8 deletions
+1 -1
View File
@@ -238,7 +238,7 @@ impl FreeSwatchNames {
self.taken.insert(name.clone());
name
}
/// Count `name` as taken (a swatch or colour group added another way).
/// Count `name` as taken (a swatch or color group added another way).
pub fn insert(&mut self, name: &str) {
self.taken.insert(name.to_string());
}