mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-16 01:26:09 +00:00
Plug-ins: unlinking a gradient stop's spot swatch also clears its plates
A filter or importer that changes a gradient paint unlinks each stop from its swatch and resets its tint, but left the stop's process plates. The PDF and EPS writers read plates only with a spot swatch, so the stop kept a plates array with no ink, saved with the document and compared in later edits. Unlinking now clears the plates too, in fills and strokes; a paint returned unchanged keeps its link, tint and plates. The plate clamping test now checks the decoded output, before admission.
This commit is contained in:
@@ -951,7 +951,8 @@ fn paints(ap: &Appearance, fill: bool) -> Vec<&Paint> {
|
||||
}
|
||||
|
||||
/// `p` without swatch links: a plug-in's colours are its own, so only paints it returned
|
||||
/// unchanged keep theirs.
|
||||
/// unchanged keep theirs. A gradient stop also loses its process plates, which print only with
|
||||
/// a spot swatch.
|
||||
fn unlinked(mut p: Paint) -> Paint {
|
||||
match &mut p {
|
||||
Paint::Solid { swatch, tint, .. } => {
|
||||
@@ -961,8 +962,7 @@ fn unlinked(mut p: Paint) -> Paint {
|
||||
Paint::Gradient(g) => {
|
||||
g.swatch = None;
|
||||
for s in &mut g.gradient.stops {
|
||||
s.swatch = None;
|
||||
s.tint = 1.0;
|
||||
s.set_color(s.color, None);
|
||||
}
|
||||
}
|
||||
Paint::None | Paint::Pattern { .. } => {}
|
||||
|
||||
Reference in New Issue
Block a user