Skip to content

[bug] PageAreas::from_page_def 머리말/본문 영역 공식 오류 — 트러블슈팅 문서 기 진단분 미반영 #236

@planet6897

Description

@planet6897

증상

머리말 컨트롤이 없는 문서에서도 렌더 결과의 본문이 머리말 높이(margin_header)만큼
아래로 밀려 렌더링된다. 시각적으로 머리말이 없는데도 머리말 영역이 확보된 것처럼 보인다.

재현: 10지점.hwpxrhwp export-svg 10지점.hwpx → SVG의 body-clip y=132.26px(=35mm)
기대: body-top = margin_top = 20mm

원인

src/model/page.rs:139-182 PageAreas::from_page_def에서

  • content_top = margin_header + margin_top (틀림)
  • header_area.top = margin_top (틀림)

이미 mydocs/troubleshootings/page_margin_area_calculation.md가 동일 이슈를 진단하며
올바른 공식을 명시해 두었으나 소스에 반영되지 않은 상태. (초기 커밋부터 누락)

수정 방향

트러블슈팅 문서의 "올바른 코드" 적용:

  • content_top = margin_top
  • content_bottom = page_height - margin_bottom
  • header_area = [margin_header, margin_top]
  • footer_area = [page_height - margin_bottom, page_height - margin_footer]

파급

  • 스냅샷 테스트 골든파일 재생성 필요 가능
  • k-water-rfp.hwp 페이지 수 감소 재현 기대 (29쪽→27쪽)
  • 기존 통합 테스트 회귀 검증 필요

재현 자료

  • 파일: 10지점.hwpx
  • 관련 기존 문서: mydocs/troubleshootings/page_margin_area_calculation.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions