Files
OCR/backend/app
egg b1de7616e4 fix: implement actual list item spacing with Y offset adjustment
Previous implementation only expanded bbox_height which had no visual effect.
New implementation properly applies spacing_after between list items.

Changes:
1. Track cumulative Y offset in _draw_list_elements_direct
2. Calculate actual gap between adjacent list items
3. If actual gap < desired spacing_after, add offset to push next item down
4. Pass y_offset parameter to _draw_text_element_direct
5. Apply y_offset when calculating pdf_y coordinate

Implementation details:
- Default 3pt spacing_after for list items (except last item in group)
- Compare actual_gap (next.bbox.y0 - current.bbox.y1) with desired spacing
- Cumulative offset ensures spacing compounds across multiple items
- Negative offset in PDF coordinates (Y increases upward)
- Debug logging shows when additional spacing is applied

This now creates actual visual spacing between list items in the PDF output.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-24 11:35:58 +08:00
..
2025-11-12 22:53:17 +08:00