fix(docx): hold a row a drawing makes tall, and raise a title pulled above its row inside its line - #792
Merged
Conversation
…above its row inside its line A row whose tallest child is drawn where the page puts it holds nothing of it in Word and was only as tall as its text; it is now held at least as tall as the page makes it. A one-line paragraph a container pulls above its cell with a negative top edge is written that much shorter, its text seated where the page sets it, no further than the room above its letters.
…ain when written again The rise is what the edges carried down, the space owed by the block above, less a border below it, and the paragraph's own top edge fall short of zero; a paragraph written again rises by the same amount.
…en above it as before
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
WorkspaceInvoicestood well off its page in Word, for two reasons.standsAboveItsCell/raiseRowsneed one.SubscriptionInvoice,MerchantInvoiceandPlatformInvoicehave rows a drawing makes tall too.What changed
writeRow:aDrawingMakesTheRow. Outside a painted panel too, a row is now held at least as tall as the page makes it (holdRowAtLeast, as inside a panel) when its tallest child — margins included, as the row is sized by them — is one whose cell Word holds nothing in (holdsNothing).LayoutCompilerplaces a row atnaturalMeasure.height()).writeContainerBody:riseIntoItsLine. A container in a cell with a negative top edge, and a one-line first paragraph, writes that paragraph as much shorter as it is pulled up. Its text is seated from where the Word line starts, using the stacked-line entryDocxStackedLines.Line.DocxInk,INK_MARGIN), as Word draws an exact line's text only inside the line. Past that, the rest stays as before.CHANGELOG.mdand the Rows row ofdocs/recipes/docx-export.mdare updated.Verification
./mvnw -B -ntp clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-render-docx,:graph-compose-render-pptx,:graph-compose-templates,:graph-compose-testing,:graph-compose-qa,:graph-compose-coverage -amgives BUILD SUCCESS (1791 + 127 tests). After install, examples are 93 green, and the knowledge checks andextract-api --checkpass.DocxRowHeightTest(new, 10 tests):WorkspaceInvoice: 4.8 → 0.4pt, lines off 78 → 6, one page.SubscriptionInvoice: 8.8 → 0.5pt.MerchantInvoice: 3.0 → 1.9pt.PlatformInvoice: lines off 30 → 21.PaymentsInvoice's bill-to block now stands level (constant +11pt), and its median rises from 3.7 to 10.3pt. Its collapsed heading row had been hiding a gap between the masthead and the parties that runs about 16pt long in Word.Lane: shared-engine (render-docx). No public API change.