Task #1197: HWPX 용지 기준 BehindText 그림/표 z-order 보존#1252
Merged
Conversation
Owner
|
메인테이너 검증 및 반영 완료했습니다.
검증: 기여 감사합니다. 이번 변경은 HWPX paper/page anchored Picture/Table/Shape의 공통 z-order contract를 잡는 데 큰 도움이 되었습니다. |
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.
요약
HWPX 용지/페이지 기준
BehindText그림·표·도형의 z-order가 타입별 렌더 경로에서 분리되어 보존되지 않던 문제를 수정합니다.textWrap,zOrder,stableIndex)를 보존하도록 했습니다.rhwp-studioCanvas2D 경로에서pageBackground -> behindText -> flow -> inFrontOfText순서로 filtered canvas layer를 합성하도록 보정했습니다.문제
HWPX 문서에서 용지 기준으로 배치된
BehindText객체가 그림/표/도형 타입별 경로로 렌더되면서 같은 z-order 축에서 합성되지 않았습니다.그 결과 낮은 z-order 표 텍스트가 전체 페이지 이미지 위에 다시 표시되거나,
InFrontOfText도형과BehindText배경 이미지의 상대 순서가 Studio 화면에서 깨질 수 있었습니다.원인
Rust 렌더 경로에서는 Picture/Table/Shape가 각각 다른
RenderNode와 PaintOp 경로를 거치면서 공통 layer metadata가 충분히 전달되지 않았습니다.추가로
rhwp-studioCanvas2D 소비자에서는 layer 분리 후에도 overlay canvas가 다음 CSS를 상속했습니다.이 때문에 z-index가 가장 높은
frontcanvas가 흰 배경을 갖게 되었고, 실제로는01만 그리는 front layer가 아래의 page background/behind/flow layer 전체를 덮어 버렸습니다.변경 내용
src/renderer/render_tree.rs/layout.rssrc/renderer/svg.rsRenderNode.layer를 우선 사용해 plane/z-order 정렬src/paint/*LayerNode.layer보존 및 inherited layer 기준 PaintOp replay plane 판정src/renderer/web_canvas.rs/src/wasm_api.rsbackgroundplane 추가rhwp-studio/src/view/page-renderer.tsrhwp-studio/src/view/canvaskit/*LayerNode.layermetadata를 상속해 non-image PaintOp plane 판정tests/issue_1197_svg_object_zorder.rsrhwp-studio/tests/render-backend.test.ts샘플 파일
저작권 사용 가능 여부는 작업지시자가 확인했습니다.
samples/hwpx/[2027] 온새미로 1 본교재.hwpxsamples/hwpx/hancom-hwp/[2027] 온새미로 1 본교재.hwppdf-large/hwpx/[2027] 온새미로 1 본교재.pdf시각 검증
작업지시자가
rhwp-studiodev server에서 원본 샘플을 로드해 확인했습니다.확인된 내용:
01전면 layer가 배경 위에 표시1주차및 설명 텍스트 표시검증
PR 생성 전 최신
upstream/devel기준으로 rebase한 뒤 다음 명령을 확인했습니다.cargo fmt --all -- --checkcargo testcargo clippy -- -D warningsnpm test(rhwp-studio/)npm run build(rhwp-studio/)git diff --check추가로 작업 중 다음 타깃 검증도 수행했습니다.
cargo test --test issue_1197_svg_object_zorder -- --nocapturecargo test --test issue_1167_svg_behindtext_zorder -- --nocapturecargo test --lib replay_orderwasm-pack build --target web샘플 파일 추가 후 다음 파일 로드도 확인했습니다.
cargo run --bin rhwp -- info 'samples/hwpx/[2027] 온새미로 1 본교재.hwpx'cargo run --bin rhwp -- info 'samples/hwpx/hancom-hwp/[2027] 온새미로 1 본교재.hwp'pdf-large/hwpx/[2027] 온새미로 1 본교재.pdf페이지 수 확인참고
제공받은 정답 PDF는 46쪽이고, 현재 rhwp pagination은 대응 HWPX를 47쪽, 대응 HWP를 50쪽으로 계산합니다.
MEMO↔ rhwp 3쪽MEMO01 / 1주차↔ rhwp 4쪽이 page count 차이는 이번 z-order/layer 합성 수정과 별도인 pagination/partial table 후속 이슈로 분리했습니다.
관련 이슈
Related: #1197