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
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:
@@ -501,18 +501,18 @@ export function StepReconstruction({ sessionId, onNext }: StepReconstructionProp
|
||||
|
||||
const cellTop = bboxPct.y
|
||||
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) {
|
||||
// Cell ABOVE box: clamp height so bottom doesn't exceed box top
|
||||
if (cellCenter < topPct && cellBottom > topPct) {
|
||||
return { ...bboxPct, h: topPct - cellTop }
|
||||
}
|
||||
// Cell BELOW box: push top down to box bottom
|
||||
if (cellCenter > bottomPct && cellTop < bottomPct) {
|
||||
const newY = bottomPct
|
||||
return { ...bboxPct, y: newY, h: cellBottom - newY }
|
||||
// Check if cell overlaps with box zone at all
|
||||
if (cellBottom <= topPct || cellTop >= bottomPct) continue
|
||||
|
||||
// Cell starts ABOVE box midpoint → belongs above, clamp bottom to box top
|
||||
if (cellTop < boxMid) {
|
||||
return { ...bboxPct, h: Math.max(0.5, topPct - cellTop) }
|
||||
}
|
||||
// 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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user