fix(form-fit): measure a cell's slot at its width on the table grid - #395
Merged
Merged
Conversation
FormFit measured a cell at its own hp:cellSz width. Hancom lays a cell's text out at its width on the table's column grid, wider than its own when another row's cells push its columns' ends apart. The grid the page estimate uses moves to hwpx.oxml.table_sizes.grid_widths_of, and resolve_slot_metrics() measures the slot there (SlotMetrics.raw_width). Co-Authored-By: Claude Opus 5.5 <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.
바뀐 점
FormFit(
resolve_slot_metrics)이 칸의 자리를 칸 자신의hp:cellSz폭에서 재던 것을 고친다. 한/글은 칸의 글을 표 격자 위의 폭으로 놓는다(#392). 그래서 같은 열의 다른 행 칸이 더 넓으면, 그 칸도 그 폭으로 놓인다.hwpx.oxml.table_sizes.grid_widths_of로 옮긴다. 칸 여백 규칙(cell_margins_of) 옆이다. 쪽 수 추정과 FormFit이 함께 쓴다.resolve_slot_metrics의 폭(SlotMetrics.raw_width)이 이제 그 칸의 격자 폭이다. 표를 읽을 수 없으면 전처럼 칸 자신의 폭이다(_grid_width).docs/architecture/module-ownership.json)의table_sizes설명에 격자를 더한다.테스트
tests/test_form_fit_hancom_rules.py에test_a_cell_slot_is_as_wide_as_its_columns_on_the_table_grid를 더한다. #392의 한/글 저장본 셋에서 다음 칸을 잰다.raw_width가 격자 폭인지 본다. 안전 계수 1.0에서 쓸 수 있는 폭이 한/글 줄 폭(horzsize)과 2 안쪽인지도 본다.raw_width가 칸 자신의 폭).🤖 Generated with Claude Code