Skip to content

feat(layout): follow cached lines beside a square object on the paper - #363

Merged
airmang merged 2 commits into
mainfrom
feat/page-estimate-cached-lines-beside-an-object-on-the-paper
Oct 1, 2026
Merged

airmang merged 2 commits into
mainfrom
feat/page-estimate-cached-lines-beside-an-object-on-the-paper

Conversation

@airmang

@airmang airmang commented Oct 1, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 곁에 자리를 남기는 종이·쪽 기준 어울림(SQUARE) 개체의 띠에 닿는 줄을, 그 줄이 줄 캐시를 가질 때 따른다.

  • 전에는 그런 개체의 띠에 줄·표·개체가 닿으면 지원 밖(text beside an object placed on the paper)이었다.
  • 한/글은 띠에 닿는 줄을 개체 곁에 좁혀 두고, 줄 높이와 간격은 그대로 둔다.
    • 개체 양옆에 자리가 있으면 한 높이에 두 조각이 놓인다.
    • 개체를 앵커한 문단보다 앞 문단의 줄도 그렇다.
  • 그래서 줄 캐시를 가진 줄은 캐시 자리 그대로다.
    • 이제 _lay_section이 줄 캐시를 가진 문단에 kept를 표시한다.
    • _Paginator는 그런 문단의 줄을 띠에 닿은 것으로 세지 않는다(_reach).
  • 캐시 없는 줄이 띠에 닿으면 전처럼 지원 밖이다. 그런 줄을 어디서 나눌지는 따르지 않는다. 표나 개체가 닿을 때도 전처럼 지원 밖이다.
  • 모듈 설명과 변경 로그를 고친다.

테스트

  • tests/test_layout_page_estimate.py에 한/글 저장본 셋을 더한다. 모두 종이 위쪽을 기준으로 둔 어울림 그림 곁으로 긴 문단이 흐르는 문서다.
    • 그림이 본문 왼쪽, 위에서 800 아래에 있는 문서: 2쪽
    • 그림이 본문 가운데에 있어 한 줄이 양옆 두 조각인 문서: 2쪽
    • 쪽 나누기 뒤 문단에 앵커한 문서: 5쪽
    • 캐시가 있으면 줄 위치와 쪽 수가 한/글과 같다. 캐시를 지우면 지원 밖이다.
  • 띠에 닿는 그림의 기존 테스트(pages_square_picture_on_paper_reaching_the_last_line)를 바꾼다. 캐시가 있으면 한/글과 같은 자리인지, 캐시가 없으면 지원 밖인지 확인한다.
  • 고치기 전 코드에서는 바꾼 테스트와 새 테스트, 넷이 모두 실패한다.

🤖 Generated with Claude Code

airmang and others added 2 commits October 1, 2026 21:30
A line reaching the band of a square-wrapped object placed on the paper
with room beside it is set beside it, narrower, at the same height and
spacing (two pieces at one height with room on both sides), in the
paragraph before its anchor too. A line keeping its layout cache is
therefore followed where it is; a line without one, a table or an object
reaching the band is still not followed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang merged commit 5f745e2 into main Oct 1, 2026
13 checks passed
@airmang
airmang deleted the feat/page-estimate-cached-lines-beside-an-object-on-the-paper branch October 1, 2026 20:13
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