mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-13 22:12:12 +00:00
Keep StencilCraft v1 fixtures with shared document crate
This commit is contained in:
4 files changed
+301
-3
No files matched your search
@@ -772,9 +772,12 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn version_1_files_without_canvas_fields_still_load() {
|
||||
for name in ["starter", "poster", "stencil-frame"] {
|
||||
let path = format!("{}/../../examples/{name}.stencilcraft", env!("CARGO_MANIFEST_DIR"));
|
||||
let doc = load_from(&path).unwrap();
|
||||
for json in [
|
||||
include_str!("../tests/fixtures/starter.stencilcraft"),
|
||||
include_str!("../tests/fixtures/poster.stencilcraft"),
|
||||
include_str!("../tests/fixtures/stencil-frame.stencilcraft"),
|
||||
] {
|
||||
let doc = Document::load_json(json).unwrap();
|
||||
assert!(doc.pages.is_empty() && doc.groups.is_empty() && doc.guides.is_empty());
|
||||
assert_eq!(doc.grid, Grid::default());
|
||||
assert!(doc.layers.iter().all(|l| !l.template && !l.locked));
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
{
|
||||
"board": {
|
||||
"height_mm": 400.0,
|
||||
"width_mm": 500.0
|
||||
},
|
||||
"kerf": {
|
||||
"apply_to_exports": false,
|
||||
"width_mm": 0.0
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"kind": "cut",
|
||||
"name": "cut",
|
||||
"shapes": [
|
||||
{
|
||||
"id": 1,
|
||||
"path": [
|
||||
{
|
||||
"MoveTo": {
|
||||
"x": 10.0,
|
||||
"y": 20.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 70.0,
|
||||
"y": 20.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 70.0,
|
||||
"y": 80.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 10.0,
|
||||
"y": 80.0
|
||||
}
|
||||
},
|
||||
"ClosePath"
|
||||
],
|
||||
"style": "cut"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"path": [
|
||||
{
|
||||
"MoveTo": {
|
||||
"x": 10.0,
|
||||
"y": 390.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 490.0,
|
||||
"y": 10.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"style": "cut"
|
||||
}
|
||||
],
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"kind": "engrave",
|
||||
"name": "engrave",
|
||||
"shapes": [
|
||||
{
|
||||
"id": 3,
|
||||
"path": [
|
||||
{
|
||||
"MoveTo": {
|
||||
"x": 100.0,
|
||||
"y": 200.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 400.0,
|
||||
"y": 200.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"style": "engrave"
|
||||
}
|
||||
],
|
||||
"visible": true
|
||||
}
|
||||
],
|
||||
"next-shape-id": 4,
|
||||
"stencilcraft": {
|
||||
"name": "stencilcraft",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"board": {
|
||||
"height_mm": 150.0,
|
||||
"width_mm": 100.0
|
||||
},
|
||||
"kerf": {
|
||||
"apply_to_exports": false,
|
||||
"width_mm": 0.0
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"kind": "cut",
|
||||
"name": "cut",
|
||||
"shapes": [
|
||||
{
|
||||
"id": 1,
|
||||
"path": [
|
||||
{
|
||||
"MoveTo": {
|
||||
"x": 10.0,
|
||||
"y": 10.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 60.0,
|
||||
"y": 10.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 60.0,
|
||||
"y": 60.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 10.0,
|
||||
"y": 60.0
|
||||
}
|
||||
},
|
||||
"ClosePath"
|
||||
],
|
||||
"style": "cut"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"path": [
|
||||
{
|
||||
"MoveTo": {
|
||||
"x": 70.0,
|
||||
"y": 20.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 85.0,
|
||||
"y": 20.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 85.0,
|
||||
"y": 60.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 70.0,
|
||||
"y": 60.0
|
||||
}
|
||||
},
|
||||
"ClosePath"
|
||||
],
|
||||
"style": "cut"
|
||||
}
|
||||
],
|
||||
"visible": true
|
||||
},
|
||||
{
|
||||
"kind": "engrave",
|
||||
"name": "engrave",
|
||||
"shapes": [
|
||||
{
|
||||
"id": 3,
|
||||
"path": [
|
||||
{
|
||||
"MoveTo": {
|
||||
"x": 10.0,
|
||||
"y": 90.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 90.0,
|
||||
"y": 90.0
|
||||
}
|
||||
}
|
||||
],
|
||||
"style": "engrave"
|
||||
}
|
||||
],
|
||||
"visible": true
|
||||
}
|
||||
],
|
||||
"next-shape-id": 4,
|
||||
"stencilcraft": {
|
||||
"name": "stencilcraft",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"board": {
|
||||
"height_mm": 150.0,
|
||||
"width_mm": 120.0
|
||||
},
|
||||
"kerf": {
|
||||
"apply_to_exports": true,
|
||||
"width_mm": 0.2
|
||||
},
|
||||
"layers": [
|
||||
{
|
||||
"kind": "cut",
|
||||
"name": "cut",
|
||||
"shapes": [
|
||||
{
|
||||
"id": 1,
|
||||
"path": [
|
||||
{
|
||||
"MoveTo": {
|
||||
"x": 0.0,
|
||||
"y": 0.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 100.0,
|
||||
"y": 0.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 100.0,
|
||||
"y": 100.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 0.0,
|
||||
"y": 100.0
|
||||
}
|
||||
},
|
||||
"ClosePath"
|
||||
],
|
||||
"style": "cut"
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
"path": [
|
||||
{
|
||||
"MoveTo": {
|
||||
"x": 30.0,
|
||||
"y": 30.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 70.0,
|
||||
"y": 30.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 70.0,
|
||||
"y": 70.0
|
||||
}
|
||||
},
|
||||
{
|
||||
"LineTo": {
|
||||
"x": 30.0,
|
||||
"y": 70.0
|
||||
}
|
||||
},
|
||||
"ClosePath"
|
||||
],
|
||||
"style": "cut"
|
||||
}
|
||||
],
|
||||
"visible": true
|
||||
}
|
||||
],
|
||||
"next-shape-id": 3,
|
||||
"stencilcraft": {
|
||||
"name": "stencilcraft",
|
||||
"version": 1
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user