Repository navigation
fix(layout): 같은 문단의 위아래 개체는 문단 흐름 시작을 차지할 때만 글자처럼 그림을 아래로 보낸다 (#8168) - #8206
Closed
planet6897 wants to merge 4 commits into
Closed
planet6897 wants to merge 4 commits into
planet6897 wants to merge 4 commits into
Conversation
planet6897
force-pushed
the
fix/8168-topandbottom-sibling-tac-picture
branch
from
October 26, 2026 08:18
c6468b0 to
dd3ad0b
Compare
This was referenced Oct 26, 2026
Contributor
Author
jangster77
self-requested a review
October 26, 2026 14:19
…kim#8168) 문단에 글자처럼 취급 그림과 떠 있는 위아래(TopAndBottom) 개체가 함께 있으면 그림 y 에 그 개체의 높이(+바깥 여백)를 무조건 더했다(edwardkim#1151 보정, `calc_sibling_topandbottom_reserved_hu`). 그 보정의 전제는 edwardkim#1151 표본 `samples/tac-verify/scenario-a-after.hwp` 처럼 개체가 문단 기준· 세로 오프셋 0 으로 이 문단의 흐름 시작을 차지하는 것이다. 종이 기준으로 줄 아래에 놓인 글상자에도 적용돼 줄의 글자는 제자리인데 그림만 글상자 자리(+83px)로 내려가 겹쳤다. - 예약은 문단 기준(`VertRelTo::Para`) 개체 중 띠 위끝(세로 오프셋)이 그림 줄 위끝(문단 첫 줄 기준 저장 vpos 차) 이하인 것만 더한다. 세 소비 지점(본문 줄 그림·빈 runs 줄 그림·문단 시작 그림 항목)이 같은 판정을 쓴다. - 한/글 2024(13.0.0.564) Print: 「앞 [그림] 글 뒤 글」이 한 줄이고 글상자는 그 줄 아래 지정 위치에 있다. edwardkim#1151 표본은 그림이 표 아래(종전과 같음). - 회귀: `issue_8168_topandbottom_sibling_tac_picture` — 종이 기준 위아래 글상자는 그림을 host 줄 안에 두고 겹치지 않는다(수정 전 실패: 그림 215.4–274.7 · 줄 132.3–191.6), edwardkim#1151 반례는 그림이 표 아래(전후 통과). 단위 검사에 종이 기준·줄 아래 개체 반례 추가. - Visual Sweep raw: 표본(`samples/issue8168/`, 한/글 2024 Print) 18.70 → 94.96(Native), 18.97 → 94.31(WASM). edwardkim#1151 표본 99.93 전후 동일. samples 1,317건 A/B 바뀐 문서 0.
…sh WASM review·overlay
단위 검사 수 기준선(issue_1151_v3_helper_tests 7개)을 늘리지 않도록, 종이 기준 개체와 줄 아래에서 시작하는 문단 기준 개체의 반례를 같은 표를 쓰는 topandbottom_table_reserved_single 의 assertion 으로 옮긴다.
- 대표 PNG(글자처럼 그림 + 종이 기준 위아래 글상자)를 rebase head 와 devel 4e690c9 에서 다시 만들었다. - 전쪽 TSV: tac_picture_with_topandbottom_textbox·scenario-a-after 의 base/head × native/wasm. - 미검증 두 경우의 합성 입력(HWP)과 생성기를 더한다. 쪽 기준 위아래 글상자, 세 줄 문단 둘째 줄 그림 + 문단 기준 위아래 글상자(세로 300HU / 비교용 9000HU). 한/글 2024 Print PDF 는 아직 없다. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
planet6897
force-pushed
the
fix/8168-topandbottom-sibling-tac-picture
branch
from
October 27, 2026 13:05
dd3ad0b to
da54116
Compare
Contributor
Author
최신 devel 로 rebase
|
Contributor
Author
Collaborator
|
기여해 주셔서 감사합니다. 제안해 주신 변경을 체리픽하고 필요한 통합 보정을 거쳐 통합 PR #8348에서
문서 비교는 Visual Sweep 가이드를 따릅니다. 위 수치는 기준 PDF와 출력의 내용 픽셀 일치율 보조값으로, 사람의 판정을 대신하지 않습니다. 후보 수와 별도 pixel match가 기록되지 않은 경우 추정하지 않았습니다. |
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.
Closes #8168
요약
문단에 글자처럼 취급 그림과 떠 있는 위아래(TopAndBottom) 개체가 함께 있으면, rhwp 는 그림 y 에 그 개체의 높이와 바깥 여백을 무조건 더했다(#1151 보정,
calc_sibling_topandbottom_reserved_hu). 그래서 종이 기준으로 줄 아래에 놓인 글상자가 있으면, 줄의 글자는 제자리인데 그림만 글상자 자리로 약 83px 내려가 글상자와 겹쳤다.#1151 보정의 전제는 그 표본(
samples/tac-verify/scenario-a-after.hwp)처럼 개체가 문단 기준·세로 오프셋 0 으로 이 문단의 흐름 시작을 차지하는 것이다. 이 PR 은 그 전제를 조건으로 쓴다.변경
src/renderer/layout/paragraph_layout.rscalc_sibling_topandbottom_reserved_hu(controls, line_top_hu)는 문단 기준(VertRelTo::Para) 개체 중 띠 위끝(세로 오프셋)이 그림 줄 위끝 이하인 것만 더한다. 종이·쪽 기준 개체와 줄보다 아래에서 시작하는 개체는 그림을 밀지 않는다.para_line_top_hu가 문단 첫 줄 기준 저장 vpos 차로 구한다.emit_line_runs), 빈 runs 줄 그림(layout_empty_runs_line), 문단 시작 그림 항목(tac_picture_item.inc.rs, 줄 위끝 0).독립 근거
samples/issue8168/tac_picture_with_topandbottom_textbox.hwpx를 Print 하면 「앞 [그림] 글 뒤 글」이 한 줄이고 글상자는 그 줄 아래 지정 위치에 있다.samples/tac-verify/scenario-a-after.hwp(문단 기준·오프셋 0 의 위아래 표 + 글자처럼 그림)는 한/글 2024 Print 에서도 그림이 표 아래에 있다 — 종전 동작을 유지한다.회귀 테스트
tests/cases/issue_8168_topandbottom_sibling_tac_picture.rs— 관계로 검사한다(절대 px 고정 없음).paper_relative_topandbottom_float_keeps_tac_picture_in_its_line— 그림이 host 줄 안에 있고 글상자 위끝보다 위para_relative_topandbottom_table_at_para_start_still_puts_picture_below— #1151 반례, 그림이 표 아래단위 검사
topandbottom_table_reserved_single에 종이 기준 개체와 줄 아래에서 시작하는 문단 기준 개체의 반례 assertion 을 더했다(모듈 검사 수는 그대로).Visual Sweep (base = devel
9418ed0c7, head = 이 PR)판정값 = 2px 실루엣 raw(TSV 4열), 한/글 2024 Print,
--compat 2024, 전 쪽.samples/issue8168/tac_picture_with_topandbottom_textbox.hwpx·pdf/issue8168/tac_picture_with_topandbottom_textbox-2024.pdfsamples/tac-verify/scenario-a-after.hwp·pdf/issue8168/scenario-a-after-2024.pdf(반례)수정 전 / 수정 후 — Native
수정 후 — fresh WASM
수정 전 WASM 과 overlay 는
mydocs/report/issue8168_topandbottom_tac_picture/에 있다.게이트 (head
c6468b0d3, base9418ed0c7)--check· unit tier--check통과.--features native-skia, release-test) 11,761건 중 11,757 통과 — 실패 4건은 devel 에서도 같은 이 host 환경 문제다(issue_7966_pdf_close_stroke3건은 Windows 체크아웃 CRLF, fix(checkout): Windows CRLF·심볼릭 링크 체크아웃에서만 실패하던 로컬 검사를 고친다 #8193 ·custom_font_paths_select_style_within_the_first_family_owner는 글꼴 설치). 이 전체 실행은 단위 검사 통합(c6468b0d3) 직전 head28ae3d4b0에서 했고, 통합 뒤에는 관련 검사 45건·Clippy all-targets·unit tier 를 다시 통과했다.최신 devel rebase (2026-10-26,
4e690c930)9418ed0c7→4e690c930(feat: 기여 PR 10건 통합과 조판·Studio 회귀 보정 #8228 통합 포함)으로 충돌 없이 rebase했다. 코드 head6e59ef78f(이전c6468b0d3), 증적·입력 커밋dd3ad0b29.paragraph_layout.rs)과 겹치는 것은 줄 범위 소유 정리(ParagraphLineRange)와 줄 앞 소비 오프셋이다. 위아래 개체 예약 판정(calc_sibling_topandbottom_reserved_hu)·세 소비 지점과 겹치지 않는다.--profile release-test --features native-skiaNative, fresh WASM. headrhwp_bg.wasmsha2565b251e31677f….samples/issue8168/tac_picture_with_topandbottom_textbox.hwpxsamples/tac-verify/scenario-a-after.hwp(반례)4e690c930vs head): 바뀐 문서는samples/issue8168/의 입력뿐이고, 그 밖의 문서 변화 0, 쪽수 변화 0. 이 실행에서 합성 입력 3건은 HWPX 판이었다. 커밋한 HWP 판은 따로 비교했다 — 쪽 기준 입력만 바뀌고 문단 기준 두 입력은 SVG 바이트가 같다. 암호 문서 3건은 양쪽 모두 열지 않는다(exit 2).6e59ef78f, base4e690c930):--prepare· rustfmt--check· Clippy native · wasm32 lib · workspace build · workspace all-targets · native-skia all-targets · manifest--check· unit tier--check통과.cargo test --profile release-test --features native-skia: 11,691건 통과, 실패 2건. 두 건은 devel4e690c930에서도 같은 메시지로 실패하는 이 host 의 native-skia 화소 검사다(issue_7445_biotoxin_source_ownership::gray_grid_keeps_its_print_coverage_cell_owners_and_pdf_origin,native_skia_public_paint_contract::renders_complete_svg_image_larger_than_a_raw_fragment).미검증 — 합성 입력 추가, 한/글 출력 대기
두 경우의 합성 입력을 추가했다. 한/글 2024 Print PDF 를 받아 대조할 때까지 미검증으로 둔다.
samples/issue8168/)4e690c930tac_picture_with_page_relative_topandbottom_textbox.hwpVertRelTo::Page) 세로 15000HU 위아래 글상자multiline_tac_picture_para_topandbottom_offset_above.hwpmultiline_tac_picture_para_topandbottom_offset_below.hwpmydocs/report/issue8168_topandbottom_tac_picture/make_unverified_inputs.mjs(편집 API →exportHwp()). 저장 LineSeg 는 rhwp 재조판 결과다.linesegarray를 빼서(한/글이 다시 계산하게 하는 devel 설계), rhwp 가 다시 열면 저장 줄 정보 없이 재조판한다. 그러면 이 PR 이 판정에 쓰는 저장 줄 위끝(para_line_top_hu)을 거치지 않는다. 이 재조판에서 그림 줄 높이와 다음 문단 위치가 틀리는 결함은 [layout] HWPX 로 저장한 뒤 다시 열면 글자처럼 그림 + 위아래 글상자 문단의 줄 높이와 다음 문단 위치가 바뀐다 (합성 입력) #8271 로 등록했다. 이슈 당시 한/글이 거부하던 HWP 저장본은 devel [serializer/hwp] 편집으로 만든 글상자의 SHAPE_COMPONENT 저장 워드에 글상자 비트(0x0100_0000)가 없어 한컴 2024가 HWP를 손상 문서로 거부한다 #8172(글상자 저장 비트)로 열린다.🤖 Generated with Claude Code