fix: Box-Zone Clamping nach Box-Mitte statt Cell-Center entscheiden
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 31s
CI / test-go-edu-search (push) Successful in 34s
CI / test-python-klausur (push) Failing after 2m8s
CI / test-python-agent-core (push) Successful in 19s
CI / test-nodejs-website (push) Successful in 21s

Euro/Badge-Zeilen hatten ihren Center innerhalb der Box-Zone, weshalb
das Clamping nicht griff. Jetzt wird anhand der Box-Mitte entschieden
ob eine Zelle nach oben (clamp height) oder unten (push y) gehoert.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-10 23:10:51 +01:00
parent 9dbb5fa708
commit eb3fc05cdc

View File

@@ -501,18 +501,18 @@ export function StepReconstruction({ sessionId, onNext }: StepReconstructionProp
const cellTop = bboxPct.y const cellTop = bboxPct.y
const cellBottom = bboxPct.y + bboxPct.h const cellBottom = bboxPct.y + bboxPct.h
const cellCenter = cellTop + bboxPct.h / 2 const boxMid = (boxZonesPct[0].topPct + boxZonesPct[0].bottomPct) / 2
for (const { topPct, bottomPct } of boxZonesPct) { for (const { topPct, bottomPct } of boxZonesPct) {
// Cell ABOVE box: clamp height so bottom doesn't exceed box top // Check if cell overlaps with box zone at all
if (cellCenter < topPct && cellBottom > topPct) { if (cellBottom <= topPct || cellTop >= bottomPct) continue
return { ...bboxPct, h: topPct - cellTop }
} // Cell starts ABOVE box midpoint → belongs above, clamp bottom to box top
// Cell BELOW box: push top down to box bottom if (cellTop < boxMid) {
if (cellCenter > bottomPct && cellTop < bottomPct) { return { ...bboxPct, h: Math.max(0.5, topPct - cellTop) }
const newY = bottomPct
return { ...bboxPct, y: newY, h: cellBottom - newY }
} }
// Cell starts AT or BELOW box midpoint → belongs below, push top to box bottom
return { ...bboxPct, y: bottomPct, h: Math.max(0.5, cellBottom - bottomPct) }
} }
return bboxPct return bboxPct
} }