diff --git a/admin-lehrer/components/ocr-pipeline/StepReconstruction.tsx b/admin-lehrer/components/ocr-pipeline/StepReconstruction.tsx index dd4f117..ad374bb 100644 --- a/admin-lehrer/components/ocr-pipeline/StepReconstruction.tsx +++ b/admin-lehrer/components/ocr-pipeline/StepReconstruction.tsx @@ -427,6 +427,20 @@ export function StepReconstruction({ sessionId, onNext }: StepReconstructionProp return Math.max(8, Math.min(18, px * (zoom / 100))) }, [imageNaturalH, zoom]) + // Box zones in percent for clamping cell positions in overlay mode + const boxZonesPct = useMemo(() => + parentZones + .filter(z => z.zone_type === 'box' && z.box) + .map(z => { + const imgH = imageNaturalSize?.h || 1 + return { + topPct: (z.box!.y / imgH) * 100, + bottomPct: ((z.box!.y + z.box!.height) / imgH) * 100, + } + }), + [parentZones, imageNaturalSize] + ) + if (!sessionId) { return
Bitte zuerst eine Session auswaehlen.
} @@ -476,20 +490,6 @@ export function StepReconstruction({ sessionId, onNext }: StepReconstructionProp ) } - // Box zones in percent for clamping cell positions in overlay mode - const boxZonesPct = useMemo(() => - parentZones - .filter(z => z.zone_type === 'box' && z.box) - .map(z => { - const imgH = imageNaturalSize?.h || 1 - return { - topPct: (z.box!.y / imgH) * 100, - bottomPct: ((z.box!.y + z.box!.height) / imgH) * 100, - } - }), - [parentZones, imageNaturalSize] - ) - // Clamp cell positions so they don't overlap with box zones const adjustCellForBoxZones = ( bboxPct: { x: number; y: number; w: number; h: number },