mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 01:34:29 +01:00
Validate generator parameters and include mask art in opening warnings
This commit is contained in:
4 files changed
+50
-3
No files matched your search
@@ -83,7 +83,7 @@ fn changed(g: &GeneratedArt) -> String {
|
||||
/// damaged, and those whose art doesn't match its file's hash. Opening runs no plug-in.
|
||||
pub fn open_notes(doc: &Document) -> Vec<String> {
|
||||
let mut notes: Vec<String> = vec![];
|
||||
doc.walk(|n| {
|
||||
let mut visit = |n: &Node| {
|
||||
let Some(g) = n.extras().generated.as_deref() else { return };
|
||||
let note = match g.state {
|
||||
State::Damaged => DAMAGED.to_string(),
|
||||
@@ -97,7 +97,10 @@ pub fn open_notes(doc: &Document) -> Vec<String> {
|
||||
if !notes.contains(¬e) {
|
||||
notes.push(note);
|
||||
}
|
||||
});
|
||||
};
|
||||
for layer in &doc.layers {
|
||||
vectorcraft_doc::swatches::walk_with_masks(layer, &mut visit);
|
||||
}
|
||||
notes
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user