mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-28 02:02:04 +01:00
Root cause: SwatchColor::from_param checked that each value was finite as an f64, then cast it to f32. A value like 1e39 became inf, and an HSB hue then wrapped (rem_euclid) to NaN. swatches.add stored Hsb([NaN, ..]), the prefs file wrote it as null, and on the next launch load_presets_json failed to parse the whole presets blob, so every user gradient, style, shape, tool/document preset and swatch fell back to the defaults. Fix: reject values whose magnitude exceeds f32::MAX with BadParams, for every colour model. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>