mirror of
https://github.com/Matysh/houseplan-card
synced 2026-10-01 04:09:17 +00:00
fix: canonicalize near-grid coordinates exactly
Issue: #223 User-Visible: yes
This commit is contained in:
committed by
claude[bot]
parent
603bb3647f
commit
d486c64576
@@ -40,6 +40,20 @@ import { fileURLToPath } from 'node:url';
|
||||
// `find` обязан встречаться в файле ровно один раз: патч, который ложится «куда
|
||||
// попало», проверяет не то, что объявлен проверять. Это контролирует --check.
|
||||
export const MUTANTS = [
|
||||
{
|
||||
id: 'snapn-returns-input-near-node',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
+ '&& node --test --test-name-pattern="snapN returns the exact nearest node" '
|
||||
+ 'test/align-grid.test.mjs',
|
||||
because: 'explicit Optimize must replace a stored ULP tail with the exact nearest grid node '
|
||||
+ 'instead of preserving the noisy input merely because its displacement is visually tiny',
|
||||
patches: [{
|
||||
file: 'src/align-grid.ts',
|
||||
find: ' return Math.round(v / GRID_STEP_N) * GRID_STEP_N;',
|
||||
replace: ' const s = Math.round(v / GRID_STEP_N) * GRID_STEP_N;\n'
|
||||
+ ' return Math.abs(s - v) <= EPS ? v : s;',
|
||||
}],
|
||||
},
|
||||
{
|
||||
id: 'union-quantization-removed',
|
||||
guard: 'npx tsc -p tsconfig.test.json && node scripts/fix-test-build.mjs '
|
||||
|
||||
Reference in New Issue
Block a user