Type: emoji go with type that effects reshape and Expand Appearance

Squashed from #3879 onto main.
This commit is contained in:
bflatastic
2026-10-24 04:49:06 +07:00
parent 94e1fa3ecc
commit c2ad9f8bbb
91 changed files with 519 additions and 168 deletions
+5 -1
View File
@@ -13,7 +13,8 @@ pub fn doc_json(doc: &Document) -> Value {
/// Tree invariants: ids unique, `node_count` equals the number of walked nodes, `next_id` above
/// every id, top level made of layers, layers only at the top or inside layers, clip groups have
/// a first child, compound children are paths.
/// a first child, compound children are paths, no image holds its own pixels (the document keeps
/// them).
pub fn check_document(doc: &Document) -> Result<(), String> {
let mut seen = HashSet::new();
let mut walked = 0usize;
@@ -32,6 +33,9 @@ pub fn check_document(doc: &Document) -> Result<(), String> {
NodeKind::Compound { children, .. } if children.iter().any(|c| !matches!(c.kind, NodeKind::Path { .. })) && err.is_none() => {
err = Some(format!("compound {} has a non-path child", n.id));
}
NodeKind::Image(im) if im.pixels.is_some() && err.is_none() => {
err = Some(format!("image {} holds its own pixels", n.id));
}
_ => {}
}
if !(n.opacity.is_finite() && (0.0..=1.0).contains(&n.opacity)) && err.is_none() {