mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-26 09:28:09 +00:00
Merge pull request #7784 from dotCooCoo/fix/a-nan-spot-tint-from-a-file-reaches-plate
Print: a spot or Registration tint that is not a finite number prints no ink
This commit is contained in:
@@ -662,6 +662,17 @@ fn a_spot_gradient_stop_prints_its_process_plates() {
|
||||
assert_eq!(first(json!({"output": {"mode": "separations", "spotsToProcess": true}})), [25.0, 10.0, 64.0, 5.0]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_spot_gradient_stop_whose_tint_is_not_a_number_prints_no_spot_ink() {
|
||||
let mut mixed = GradientStop::new(0.0, Color::cmyk(0.25, 0.1, 0.8, 0.05));
|
||||
(mixed.swatch, mixed.tint, mixed.plates) = (Some("Gold".into()), f32::NAN, Some([0.25, 0.0, 0.4, 0.0]));
|
||||
let g = GradientPaint::new(Gradient::new(GradientKind::Linear, vec![mixed, GradientStop::new(1.0, Color::cmyk(0.0, 0.0, 0.0, 0.0))]));
|
||||
let d = gold_gradient_doc(g);
|
||||
let first = |v| gradient_plates(&d, v).into_iter().map(|(s, _)| s).collect::<Vec<_>>();
|
||||
assert_eq!(first(json!({"output": {"mode": "separations"}})), [25.0, 0.0, 40.0, 0.0, 0.0], "Cyan, Magenta, Yellow, Black, Gold");
|
||||
assert_eq!(first(json!({"output": {"mode": "separations", "spotsToProcess": true}})), [25.0, 0.0, 40.0, 0.0]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_freeform_gradients_points_separate_into_plates() {
|
||||
let mut g = GradientPaint::new(Gradient::new(GradientKind::Freeform, vec![GradientStop::new(0.0, Color::cmyk(0.0, 0.0, 0.0, 1.0))]));
|
||||
|
||||
Reference in New Issue
Block a user