SVG export: rectangles, circles, ellipses, lines and straight paths as SVG shape elements (#4652)

This commit is contained in:
bflatastic
2026-10-30 09:45:59 +07:00
parent c733ae97f0
commit beb0ae6515
26 changed files with 294 additions and 45 deletions
+1 -1
View File
@@ -68,7 +68,7 @@ fn solid_effects_apply_save_edit_export_expand_and_undo() {
assert!(s.execute("effect.setParams", &json!({"index": 0, "params": {"bevel": "nope"}, "ids": [id.0], "item": null})).is_err());
let svg = s.execute("document.serialize", &json!({"format": "svg"})).unwrap();
let svg = svg["data"].as_str().or_else(|| svg["text"].as_str()).map(str::to_string).unwrap_or_else(|| svg.to_string());
assert!(svg.matches("<path").count() >= 2, "{effect}: exported as vector faces");
assert!(vectorcraft_testkit::svg_shapes(&svg) >= 2, "{effect}: exported as vector faces");
s.execute("effect.expandAppearance", &json!({"ids": [id.0]})).unwrap();
assert!(matches!(node(&s, id).kind, NodeKind::Group { .. }), "{effect}");
assert!(!effects::has_solid(&node(&s, id)));