mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 13:47:21 -06:00
DXF export: an open path of one straight segment is written as a LINE
An open path with a single straight segment was written as a two-vertex LWPOLYLINE (POLYLINE before R14). It is now a LINE entity from its start to its end point. A stroke with a weight in R12, R13 and R14 keeps its polyline, since a LINE has no width. Closed paths and paths with more than one segment are unchanged. Part of #1299.
This commit is contained in:
@@ -93,7 +93,7 @@ fn selected_only_exports_the_selection_in_its_layers() {
|
||||
let line = s.execute("shape.line", &json!({"x1": 0, "y1": 90, "x2": 90, "y2": 90})).unwrap()["id"].as_u64().unwrap();
|
||||
s.execute("select.set", &json!({"ids": [line]})).unwrap();
|
||||
let dxf = text(&s.execute("document.export", &json!({"format": "dxf", "selectedOnly": true})).unwrap());
|
||||
assert_eq!(entities(&dxf), ["LWPOLYLINE"]);
|
||||
assert_eq!(entities(&dxf), ["LINE"]);
|
||||
assert!(dxf.contains("\n 2\nTop\n") && !dxf.contains("\n 2\nLayer 1\n"), "only the selection's layer");
|
||||
s.execute("select.none", &json!({})).unwrap();
|
||||
let e = s.execute("document.export", &json!({"format": "dxf", "selectedOnly": true})).unwrap_err().to_string();
|
||||
|
||||
Reference in New Issue
Block a user