Skip to content

fix(layout): make a table cell reach the foot of a drawing placed in it - #345

Merged
airmang merged 5 commits into
mainfrom
fix/page-estimate-objects-in-table-cells
Oct 1, 2026
Merged

airmang merged 5 commits into
mainfrom
fix/page-estimate-objects-in-table-cells

Conversation

@airmang

@airmang airmang commented Sep 30, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 표 칸 안에 둔 그림·도형의 높이를 행 높이에 넣는다.

  • 대상: 글 없는 칸 문단에서, 문단 위를 기준으로 위아래나 어울림(SQUARE)으로 둔 그림·도형이다. 글자처럼 둔 것과 표는 빠진다.
  • 한/글은 칸을 그 개체의 아래 끝(띄운 거리와 바깥 여백 포함)까지 잡고, 행이 그만큼 자란다. 문단의 빈 줄은 문단 윗선에 그대로 있다.
    • 전에는 그 개체를 세지 않아 행을 한 줄 높이로 잡았다.
  • _Measure.stack()이 칸 문단마다 _objects_reach()로 개체의 아래 끝을 구하고, 줄보다 낮으면 그 높이를 쓴다. 표를 글자처럼 둔 경우와 흐르는 경우 모두 그렇다.
  • 글이 있는 문단은 글이 개체 아래로 가므로 이 변경에서 다루지 않는다(전과 같다).
  • 모듈 설명과 변경 로그를 고친다.

테스트

tests/test_layout_page_estimate.py

  • 한/글이 저장한 fixture 6개를 HANCOM_PAGES에 더한다. 모두 2×2 표의 첫 칸 문단에 글 없이 개체만 둔 것이다.
    • 위아래 사각형(15000×10000). 흐르는 표와 글자처럼 둔 표.
    • 문단 윗선에서 500 띄운 사각형.
    • 어울림 사각형(5000×8000). 빈 줄은 그 곁에 있다.
    • 위아래 그림.
    • 칸 첫 문단은 글 한 줄이고, 둘째 문단에 사각형을 둔 것.
  • 캐시가 있을 때와 지웠을 때 모두 쪽 수와 모든 줄의 세로 위치가 한/글과 같다.

고치기 전 코드에서는 새 테스트 12개가 모두 실패한다.

🤖 Generated with Claude Code

airmang and others added 2 commits October 1, 2026 04:32
A picture or drawing placed top and bottom or wrapped square from a cell
paragraph that holds no text, not set as a character, makes the cell reach
its foot, its outer margins included, and the row grows to hold it; the
paragraph's own line stays at its top. It was left out, the row one line
tall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ects-in-table-cells

# Conflicts:
#	src/hwpx/layout/pages.py
@airmang

airmang commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

main(7c6606c)을 합쳤습니다(b8b312d). 충돌은 src/hwpx/layout/pages.py 모듈 설명이었습니다. #336이 같은 문장을 고쳐서 생겼고, 양쪽 문장을 모두 두었습니다. 합친 상태에서 전체 테스트와 게이트(hygiene, ruff, generics, census, mypy, pyright)가 통과했고, coverage ledger는 main과 같습니다. 지금 main(bbc6c0e)과도 충돌이 없습니다.

🤖 Generated with Claude Code

airmang and others added 2 commits October 1, 2026 18:47
# Conflicts:
#	tests/test_layout_page_estimate.py
…ects-in-table-cells

# Conflicts:
#	CHANGELOG.md
@airmang

airmang commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

main(e64c194e, #340·#342 병합)을 합쳤습니다(d26cec99). 충돌은 변경 로그뿐이었고, main의 [Unreleased] / ### 고침 목록에 이 PR 항목을 그대로 두었습니다. pages.py는 충돌 없이 합쳐졌고 이 PR의 변경은 그대로입니다. 쪽 수 추정 테스트와 게이트를 다시 통과했습니다.

# Conflicts:
#	tests/test_layout_page_estimate.py
@airmang
airmang merged commit 2eb5653 into main Oct 1, 2026
13 checks passed
@airmang
airmang deleted the fix/page-estimate-objects-in-table-cells branch October 1, 2026 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant