Repository navigation
fix(pages): break the lines beside a square-wrapped object placed on the paper - #660
Conversation
| paras.append(replace(para, paper=on_paper, held=held) if on_paper else para) | ||
| paper = {index: para.paper for index, para in enumerate(paras) if para.paper} | ||
| if not page.rebreak and any(band[4] is not None for objects in paper.values() for band in objects): | ||
| return _paginate(measure, section, replace(page, rebreak=True), notes, moved) # lines broken beside them |
There was a problem hiding this comment.
[P2] 새 종이 어울림 경로에서도 글자 테두리 높이를 보존해 주세요. 이 재귀가 만드는 _Reflow는 _held_sizes를 저장하지 않고, banded()도 _line_metrics에 held를 넘기지 않습니다. 공개 API 재현: 기존 pages_character_border_line_height.hwpx에서 모든 linesegarray를 제거하고, 실제 글자가 위·아래 테두리를 가진 첫 문단 바로 앞에 빈 앵커 문단을 둡니다. 앵커에 1000×50000 사각형을 추가하여 textWrap=SQUARE,textFlow=RIGHT_ONLY,treatAsChar=0,vertRelTo=PAGE,horzRelTo=PAPER,TOP/LEFT,offsets=0으로 놓습니다. 그림은 본문 왼쪽 여백에 완전히 놓이며 줄 너비는 양쪽 모두 42520입니다. 같은 빈 앵커만 있는 입력과 비교하면 unsupported 없이 뒤 세 문단 vertpos가 4888/6576/8264에서 4800/6400/8000으로 줄어듭니다(26쪽 유지). 사각형이 차지하지 않는 본문의 테두리 줄 높이가 reflow 중 사라진 결과입니다. held/end/head를 banded/at 및 이어지는 쪽에 오프셋을 맞춰 전달하거나 지원 불가로 처리하고, 테두리 글자가 있는 공개 회귀를 추가해 주세요.
…the paper Hancom narrows every line of the page whose top is above such an object's foot and whose characters reach below its top, in any paragraph there (those before its anchor too), or splits it in two pieces at one height with room on both sides. The estimate now breaks those lines beside the object's band as it does for a band that went on to a page's top, instead of leaving the section unsupported; the rest of a paragraph going on to the next page is broken there at the whole width. A square-wrapped object centred on the paper now leaves the room beside it measured from its centre. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…paragraph's margins Beside a square-wrapped object placed on the paper, Hancom runs a line from the paragraph's margin to the object, or from the object to the margin: the margin on the object's side takes no more than the object does. The estimate now does so instead of taking both away. Several such objects settle their pages one after another, so the section is laid out again up to once more for each of them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2428843 to
1a84625
Compare
airmang
left a comment
There was a problem hiding this comment.
새 head 1a84625 / base edfaa654d0388dce9cd5ffc0f5d41a8f16392399를 재검토했습니다. 이전 head와의 변경은 main의 #661 통합이며, 이 PR 자체의 소스·테스트 추가/삭제 줄과 새 fixture 두 개는 동일합니다. 충돌은 해소됐고 정확한 head의 전체 CI 7,643 passed/18 skipped/1 xfailed 및 Ruff/mypy/Pyright 통과 로그를 확인했습니다. 그러나 기존 공개 API 재현은 최신 head에서도 세 문단 vertpos 4888/6576/8264 → 4800/6400/8000으로 동일하게 발생합니다. 본문 밖 여백 그림에 의해 테두리 줄 높이가 사라지는 기존 P2와 해당 미해결 스레드(https://github.com/airmang/python-hwpx/pull/660#discussion_r4461977621)를 유지하므로 병합을 보류합니다. 동일한 인라인 지적은 반복하지 않습니다. 자기 PR이므로 COMMENT로 기록합니다.
무엇을 고쳤나
종이(또는 쪽) 기준으로 놓인 어울림 개체 곁에 글이 오면
estimate_pages가 지금까지 그 구역을 지원 밖(text beside an object placed on the paper)으로 두었습니다. 이제 한/글이 하는 대로 줄을 나눕니다.다음 경우는 계속 지원 밖으로 둡니다.
줄 캐시는 원래 어울림 개체가 있는 쪽을 쓰지 않으므로 바뀐 것이 없습니다.
시험
pages_square_object_on_the_paper(8쪽)pages_square_object_on_the_paper_beside_margins(19쪽)🤖 Generated with Claude Code