Skip to content

fix(layout): count a square-wrapped control right at a line start on the line before - #461

Merged
airmang merged 1 commit into
mainfrom
fix/page-estimate-square-control-at-a-line-start
Oct 12, 2026
Merged

airmang merged 1 commit into
mainfrom
fix/page-estimate-square-control-at-a-line-start

Conversation

@airmang

@airmang airmang commented Oct 12, 2026

Copy link
Copy Markdown
Owner

무엇

#458 리뷰 메모에서 확인할 것으로 남긴 경계 경우다. 어울림(textWrap="SQUARE") 개체의 컨트롤이 앞 줄을 꼭 채운 바로 뒤, 곧 다음 줄의 시작에 올 때를 다룬다.

  • 한/글은 그 컨트롤을 글이 끝나는 앞 줄에 든 것으로 센다. #443에서 위아래 배치 개체의 자리가 끝나는 줄에 남은 것과 같은 규칙이다.
  • 개체는 그 줄 위에서부터 놓인다. 예를 들어 첫 줄을 꼭 채운 글 뒤라면 문단 위에서부터 놓인다.
  • 쪽 수 추정은 줄 배치 정보가 없는 문서에서 이 컨트롤을 다음 줄로 셌다(start <= place). 그래서 개체와 그 곁 줄이 한 줄 아래로 내려갔다. 이제 start < place로 센다.

확인

  • 한/글로 저장한 합성 문서 4개(표 30000 x 20000, 컨트롤이 글 42·43·44·86자 뒤, 첫 줄은 43자):
    • 43자 뒤: 한/글은 첫 줄부터 곁(문단 위부터)에 둔다.
    • 86자 뒤: 한/글은 둘째 줄부터 곁에 둔다.
    • 고치기 전 추정은 줄 배치 정보 없이 2/4판이 맞았고, 지금은 4/4판이다(줄 배치 정보가 있을 때는 전에도 4/4).
  • 경계 두 판을 고정 자료로 더했다(pages_square_table_after_a_full_first_line, pages_square_table_after_two_full_lines, 메타데이터 비움). 새 시험 4건 중 2건(줄 배치 정보 없음)은 고치기 전 코드에서 실패한다.
  • 어울림·개체 관련 합성 묶음 22개는 고치기 전과 결과가 같다.
  • 이 PC 전체 시험: 실패 16건은 기준선과 같고, 새 실패는 0건이다(6,715 통과). 배치 관련 시험 1,867건과 ruff·mypy·pyright·오류 코드 집계·c901도 통과했다.

🤖 Generated with Claude Code

…the line before

A square-wrapped object's control right where a line starts, the line
before full: Hancom counts it on that line before, where its text ends
(as #443 found for a top-and-bottom object's anchor), and places the
object from that line's top. The page estimate counted it on the next
line when the document had no layout cache, putting the object and the
lines beside it a line lower.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang

airmang commented Oct 12, 2026

Copy link
Copy Markdown
Owner Author

리뷰 결과: 병합합니다(CI 통과 뒤). #458 리뷰에서 남긴 경계가 확인됐습니다. 한/글 저장본에서 43자로 첫 줄이 꽉 찬 뒤의 컨트롤은 첫 줄부터 개체 곁으로 좁아지고(그 줄 horzpos 30000), 86자 뒤는 첫 줄이 단 폭이고 둘째 줄부터 좁아집니다. 줄 시작에 정확히 걸린 컨트롤을 글이 끝나는 앞 줄에 세는 start < place가 이와 같고, #443의 위아래 배치 개체와도 같은 규칙입니다. 새 시험 넷 중 둘이 고치기 전 코드에서 실패하고 test_layout_page_estimate.py 1,365건이 통과합니다.

@airmang
airmang merged commit 0c85118 into main Oct 12, 2026
13 checks passed
@airmang
airmang deleted the fix/page-estimate-square-control-at-a-line-start branch October 12, 2026 03:22
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