From a65d251c87f33a46b80d3e979981766a9887136a Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Wed, 2 Dec 2026 11:52:55 -0800 Subject: [PATCH] Scripts: DXF scale tests fail on a drawing with no polyline vertices dxf_widest and dxf_leftmost folded from f64::MIN and f64::MAX, so a DXF that kept its header but lost every vertex gave an infinite product and the unitScaleRatio and pica assertions still passed. Both now reduce the coordinates and fail when there are none. docs/mcp.md: a relative save or open path is resolved against the working folder of the process that wrote or read the file. --- crates/engine/src/tests/script_save_open.rs | 4 ++-- docs/mcp.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/tests/script_save_open.rs b/crates/engine/src/tests/script_save_open.rs index 7fd60b9f94..b3dd0d2ded 100644 --- a/crates/engine/src/tests/script_save_open.rs +++ b/crates/engine/src/tests/script_save_open.rs @@ -423,12 +423,12 @@ fn dxf_header(dxf: &str, name: &str) -> Option { /// The largest x coordinate (group code 10) in the entities of a DXF. fn dxf_widest(dxf: &str) -> f64 { - dxf_xs(dxf).into_iter().fold(f64::MIN, f64::max) + dxf_xs(dxf).into_iter().reduce(f64::max).expect("DXF contains polyline vertices") } /// The smallest x coordinate (group code 10) in the entities of a DXF. fn dxf_leftmost(dxf: &str) -> f64 { - dxf_xs(dxf).into_iter().fold(f64::MAX, f64::min) + dxf_xs(dxf).into_iter().reduce(f64::min).expect("DXF contains polyline vertices") } /// The x coordinates (group code 10) of the polyline vertices in a DXF. A hatch's code 10 is its diff --git a/docs/mcp.md b/docs/mcp.md index ca6d350642..8a2928c0a8 100644 --- a/docs/mcp.md +++ b/docs/mcp.md @@ -3301,7 +3301,7 @@ through `$`: writes only the file at the path, holding that artboard. Without `saveMultipleArtboards`, a `.ai` or EPS `artboardRange` is not checked against the document's artboards, but one that is not written as a range of artboard numbers (such as `abc` or `0-`) throws. `Document.path` is a `Folder` for the folder of the document's - file. A file saved or opened under a relative path is in the working folder of the process that wrote or read it, + file. A relative path that a file is saved or opened under is resolved against the working folder of the process that wrote or read it, for `fullName`, `path` and `close` alike. A document that has no file has a `fullName` of a `File` for its name in `Folder.current` and a `path` of `""`. `fullName` and `path` of a document whose file the automation read roots do not allow throw `Script file access denied`. Changing `saved` runs `document.setSaved`: `true` records the document as saved