Repository navigation
fix(docx): set a panel set in from its cell's text where the page sets its text - #949
Merged
Merged
Conversation
…s its text - In a cell, Word and LibreOffice set a nested table's left border with its outer edge at the cell's text, or as far in as its indent sets it, and its text that border's centre and the cell's margin in. A panel's margin was its padding less half that border, so a panel set in from its cell's text stood its text half that border left of the page's. - It now keeps its whole left padding as its margin where it is set in half its border or more, and what it is set in by of that half where less. A panel hung out of its cell or bled left is unchanged. - Measured on Windows: CharcoalGold's headings stood their text 0.72pt left of the page's in Word and 0.71 to 0.81pt in LibreOffice, now 0.12 and 0.04 to 0.14pt right, their rules with them; a card set in 5pt from a filled panel's text 1 and 0.9pt left, now 0.06 and 0.1pt right. No line breaks differently in either editor. - Tests: a nested card set in, set in half a point, hung and bled; a padding thinner than half its border; a heading set in from a stack's column edge.
DemchaAV
marked this pull request as draft
October 23, 2026 11:56
…argin - A card in a row's column, set in by a margin on the page, stands on its cell's text, which starts past that margin, and keeps none of its border's half. - The CHANGELOG and the comments say a panel hung on its cell's text is moved right by half its border, and a bled one by its bleed too, its text with it. - The recipe's Borders bullet points to the left edge under Nesting, and its Measured bullet counts a card set in from a filled panel's text as measured.
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.
Why
A painted container in a table cell is written as a nested one-cell table (
writePanelPiece). Its indent is its edge less half its left border (edge − halfLeft), and its left margin is its padding less that half (insideTheBorders).In a cell, Word and LibreOffice set a nested table's left border with its outer edge at the cell's text, or as far in as a positive indent sets it. They set its text at that border's centre plus the cell's margin.
A panel hung on the cell's text is moved right by half its border, and the half its margin gave back puts its text where the page sets it. A bled one is moved by its bleed too, its text with it, which the report names (
left edge). For a panel set in from the cell's text by half its border or more, nothing moves the table. Its border stood where the page draws it, and its text stood half that border left of the page's. A panel set in less stood its text as far left as it was set in.Measured on Windows:
CharcoalGold's headings, set in from their layer stack column's edge (1.7pt accent)The left end of the text measured within 0.13pt of the page's in three cases:
What changed
writePanelPiecekeeps of the left border's half what the panel is set in by (setIn = min(halfLeft, max(0, edge))). In a cell its left margin ispadding.left − halfLeft + setIn:setCellMarginwrites none.halfLeft − indent), is now exactly what the table's left side gives its text.writePanel;insideTheBorders;Verification
DocxContainerPaintTest(+4 new, 1 updated):CharcoalGold's main column is, keeps its 9pt padding.A fifth, writing a margin below zero, cannot change the file, as
setCellMarginwrites none.CharcoalGold's headings: text now +0.12pt in Word and +0.04 to +0.14pt in LibreOffice. Their rules now +0.13 to +0.16pt; they stood 0.7pt left with their words. Their bars are unchanged.cv-charcoal_gold: 7 heading words move 0.8 to 0.9pt right. Notes are unchanged, 1385../mvnw -B -ntp clean verify -pl <core, render-pdf, render-docx, render-pptx, templates, testing, qa, coverage> -am→ BUILD SUCCESS: core 821, render-pdf 339, render-docx 2086, testing 5, render-pptx 142, templates 127, qa 1828../mvnw -f examples/pom.xml test→ BUILD SUCCESS, 93 tests../mvnw verify -pl :graph-compose-render-docx→ BUILD SUCCESS, 2087 tests, and the qa documentation guards → 150 tests, BUILD SUCCESS.Lane: shared-engine (render-docx): no public API change.