Task #768: Distribute 다단 column-break wrap-around (shortcut.hwp p3 정정)#772
Closed
planet6897 wants to merge 6 commits into
Closed
Task #768: Distribute 다단 column-break wrap-around (shortcut.hwp p3 정정)#772planet6897 wants to merge 6 commits into
planet6897 wants to merge 6 commits into
Conversation
shortcut.hwp 페이지 3 끝의 "<편집 화면 분할에서>" + "화면 이동" 행이 페이지 4 첫 줄로 밀리는 결함. Root cause (정적 분석): typeset.rs:261-273 의 advance_column_or_new_page 가 마지막 단(current_column+1 == col_count)에서 column-break 만나면 무조건 push_new_page. PDF 권위(한글 2022)는 같은 다단 영역에 col 0 wrap-around (좌단 7행, 우단 7행). 정정 방향 (가설 H1): 다단 영역 마지막 단의 column-break 는 페이지 잔여 공간이 충분하면 col 0 으로 wrap-around, 부족 시만 push_new_page. ref edwardkim#768 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tests/issue_768.rs 신규. samples/basic/shortcut.hwp 의 pi=94
("<편집 화면 분할에서>") 가 PDF 권위(한글 2022) 정합 인덱스 2 (3쪽) 에
등장함을 단언.
RED 결과 (의도된 FAIL):
pi=94 등장 페이지 인덱스 = 3 (page_count=8), PDF 권위 = 2
→ column-break 가 다단 영역 마지막 단에서 페이지 break 강제
부수 관찰: shortcut.hwp 4쪽에서 별개 LAYOUT_OVERFLOW (본 task 비범위).
ref edwardkim#768
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Root cause: typeset.rs:417 의 column-break + has_diff_col_def=false + last col 분기에서 push_new_page 강제 (페이지 잔여 공간 무시). 정정 시도 3 차례: 1. 무가드 wrap → 회귀 3건 (페이지 수 절반 수준) 2. vpos=0 가드 → 회귀 3건 (잔존) 3. vpos=0 + controls=0 가드 → 회귀 2건 (test_539, test_548) 본질: shortcut.hwp pi=94 (wrap 의도) 와 21_언어_기출_편집가능본.hwp pi=44/71/... (push_new_page 의도) 가 단순 IR 필드 (column_type, vpos, controls) 로 구분되지 않음. 다단 분배 algorithm 의 깊은 재설계가 필요. src/renderer/typeset.rs revert. 회귀 0 (issue_768 만 FAIL — RED 유지). 옵션 A/B/C (revert/부분정정/RFC) 중 결정 요청. ref edwardkim#768 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…round 본질 (다단 유형별 column-break 동작): - Distribute(배분) / Parallel(병행) 다단: column-break = col div 마감 신호 → 마지막 단에서 같은 페이지 내 새 col div (zone) 추가 - Normal(일반/신문형) 다단: column-break = 일반 텍스트 연속과 등가 → 마지막 단이면 페이지 break (기존 동작 유지) src/renderer/typeset.rs:417-446 column-break 분기에 ColumnType 가드 추가. advance_column_break_wrap_in_multi 보조 함수 신규 (process_multicolumn_break 의 zone 진입 로직 반영, ColumnDef/col_count/layout 변경 없이). PDF 정합: shortcut.hwp: 8 → 7 (PDF 7) ✓ Distribute exam_math.hwp: 20 (PDF 20) ✓ Normal (영향 없음) 21_언어_기출: 15 (영향 없음) ✓ Normal 회귀 검증: cargo test --release: 1217 passed; 0 failed; 2 ignored test_539 / test_548 / test_exam_math_page_count 모두 PASS ref edwardkim#768 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cargo test --release: 1217 passed, 0 failed (회귀 0) 205 샘플 광범위: shortcut.hwp만 변경: 8→7쪽 (PDF 7 정합), DRAW 12→11 (-1), FLOW 13→14 (+1) 그 외 204 샘플: 변동 없음 ColumnType 가드 (Distribute/Parallel) 로 핀포인트 정정. Newspaper(일반) 다단 샘플은 영향 없음. ref edwardkim#768 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
본질: 한컴 다단 분배의 column-break 처리는 ColumnType 에 따라 다름.
- Distribute/Parallel: col div 마감 신호 (zone 추가)
- Normal: 일반 텍스트 연속과 등가 (advance/page break)
정정: src/renderer/typeset.rs:417 column-break 분기에 ColumnType 가드 추가.
Distribute/Parallel + 마지막 단 시 advance_column_break_wrap_in_multi 호출
(같은 페이지 내 새 zone). Normal 다단은 기존 동작 유지.
검증:
RED → GREEN: pi=94 페이지 인덱스 3 → 2 (PDF 정합)
cargo test: 1217 passed, 0 failed (회귀 0)
205 샘플 광범위: shortcut.hwp만 변경 (8→7쪽, PDF 정합)
PDF 정합: shortcut 7쪽, exam_math 20쪽 모두 일치
plans/task_m100_768{,_impl}.md → plans/archives/ 이동.
closes edwardkim#768
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/renderer/typeset.rs:417column-break 분기에ColumnType::Distribute | Parallel가드 추가. 마지막 단 + Distribute/Parallel 시advance_column_break_wrap_in_multi호출 (같은 페이지 내 새 zone). Normal 다단은 기존 동작 유지Root cause
src/renderer/typeset.rs:advance_column_or_new_page가current_column + 1 >= col_count시 무조건push_new_page. PDF 권위(한글 2022) 의 Distribute 다단 동작은 col 0 으로 wrap-around (같은 다단 영역에 좌단/우단 추가행).samples/basic/shortcut.hwpsamples/exam_math.hwpsamples/21_언어_기출_편집가능본.hwp정정
src/renderer/typeset.rs:417column-break 분기에 ColumnType 가드:advance_column_break_wrap_in_multi보조 함수 신규 —process_multicolumn_break의 zone 진입 로직 (zone_y_offset 누적, col=0, h=0) 을 ColumnDef 변경 없이 수행. 페이지 잔여 공간 1 line 미만 시push_new_page폴백.검증
RED → GREEN
→ pi=94 ("<편집 화면 분할에서>") 등장 페이지 인덱스 3 → 2 (PDF 권위 정합).
회귀 (cargo test --release)
광범위 (205 샘플)
LAYOUT_OVERFLOW_DRAW총LAYOUT_OVERFLOW총샘플별 변경:
shortcut.hwp(Distribute): 페이지 8→7 (PDF 권위 7 정합 ✓)→ shortcut.hwp 단독 영향. Newspaper / Distribute 미동반 다단 회귀 0.
PDF 정합
Test plan
cargo test --test issue_768PASS (RED → GREEN)cargo test --release1217 passed, 0 failed (회귀 0)closes #768
🤖 Generated with Claude Code