fix(anatomy): V1-2.2 model arcs as browsers store them

Second security review: endpoints equal in f32 draw no arc, as in
browsers; an arc carries the spread of its f32 variants (endpoint or
radius moved one ulp) in its deviation and their extremes in its
bounds. Probe and mutants extended.
This commit is contained in:
bchanot committed 2026-11-01 13:04:43 +01:00
1 parent 03be75beed
commit 86dce16b09
5 files changed
+141 -19

No files matched your search

+10 -1
View File
@@ -21,6 +21,7 @@ use serde_json::{Value, json};
const FIXTURE: &str = "apps/app/e2e/fixtures/interior-probe.json";
const THIN: &str = "annotation.geometry.interior_too_small";
const UNREADABLE: &str = "annotation.geometry.out_of_frame";
const TOO_SMALL: &str = "annotation.geometry.too_small";
const PHONE: &str = "0 0 286 310";
/// The widest disc of a shape, measured to a thousandth of a unit: centre and radius; none for
@@ -195,6 +196,12 @@ fn cases() -> Vec<Value> {
path("M40 50A1e-49 1e-49 0 0 1 90 50Z"),
plain,
),
// Endpoints one `f32` point: browsers draw no arc, `f64` would draw a full circle.
case(
"arc-endpoints-equal-in-f32",
path("M40 50A20 20 0 1 1 40.000001 50Z"),
plain,
),
]
}
@@ -221,7 +228,9 @@ fn equine() -> Vec<Value> {
fn the_interior_probe_is_current() {
let cases = cases();
for c in &cases {
let refused = c["codes"] == json!([THIN]) || c["codes"] == json!([UNREADABLE]);
let refused = [THIN, UNREADABLE, TOO_SMALL]
.iter()
.any(|code| c["codes"] == json!([code]));
assert!(c["accepted"] == json!(true) || refused, "{}", c["name"]);
}
let probe = json!({