From 3746d1ae90456548b0433960bee4289fb6bbc2bd Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Sat, 14 Mar 2026 13:15:04 +0300 Subject: [PATCH] Fix comparison: read individual corner radii when independentCorners=true\n\nResult: {"status":"keep","total_diffs":99,"visibility":1,"text":0,"fills":10,"radius":14,"size":74,"unmatched":99} --- autoresearch-compare.ts | 12 ++++++++++-- autoresearch.jsonl | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/autoresearch-compare.ts b/autoresearch-compare.ts index 37bda7cf6..60f7e175f 100644 --- a/autoresearch-compare.ts +++ b/autoresearch-compare.ts @@ -60,8 +60,16 @@ function collect(proxy: ReturnType, parentPath: string, si const chars = (proxy as unknown as { characters?: string }).characters if (proxy.type === 'TEXT' && chars) entry.text = chars if (visibleFill) entry.fill = colorHex(visibleFill.color) - const cr = raw.cornerRadius as number | undefined - if (cr && cr > 0) entry.cr = Math.round(cr * 10) / 10 + let cr = raw.cornerRadius as number + if (raw.independentCorners) { + const tl = raw.topLeftRadius as number ?? 0 + const tr = raw.topRightRadius as number ?? 0 + const br = raw.bottomRightRadius as number ?? 0 + const bl = raw.bottomLeftRadius as number ?? 0 + if (tl === tr && tr === br && br === bl) cr = tl + else cr = Math.max(tl, tr, br, bl) + } + if (cr > 0) entry.cr = Math.round(cr * 10) / 10 if (raw.clipsContent) entry.clip = true ourNodes.set(path, entry) diff --git a/autoresearch.jsonl b/autoresearch.jsonl index 01c7a8c18..5da596732 100644 --- a/autoresearch.jsonl +++ b/autoresearch.jsonl @@ -1 +1,2 @@ {"type":"config","name":"Figma .fig import fidelity","metricName":"total_diffs","metricUnit":"","bestDirection":"lower"} +{"run":1,"commit":"8a90594","metric":246,"metrics":{"visibility":1,"text":0,"fills":10,"radius":161,"size":74,"unmatched":99},"status":"keep","description":"Baseline: 246 diffs (1 vis, 0 text, 10 fills, 161 radius, 74 size, 99 unmatched)","timestamp":1773482910363,"segment":0}