fix(docx): take a line's upward pull off the line above it when no space above can give it - #797
Merged
Merged
Conversation
…ne above, then the top of the pulled line
…d leave an underlined line whole
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
CobaltRota's masthead stood about 7pt low in Word, and the whole rota under it with it.What changed
standsIntoTheSpaceAbove. Where the space above still falls short after the pull is netted, a paragraph takes the rest in two steps.takeFromTheLineAbove. It takes from the foot of the line written just before. That must be the Word paragraphwriteParagraphwrote last (lastWrittenNode/lastWrittenParagraph), stilllastBodyParagraph, and on the page the pulled paragraph starts on. It must also be one exact line of text, not one of a stack, with no space below it and no run shaded or underlined: shading fills the line, and an underline is drawn below the letters.DocxStackedLines.INK_MARGINclear. That room is read off Word's geometry: its baseline a fifth of the line above the foot, raised by the runs' writtenw:position, the letters' reach taken unseated fromDocxInk.riseInsideItsOwnLine. It takes what is left from the top of the pulled line, asriseIntoItsLinedoes for a container's first line: aDocxStackedLines.Linelimited by the room above its letters, seated where the page sets it.lastBodyParagraph, so the line above is never one across them. A line holding a picture has no inkDocxInkcan read, so it is left whole.CHANGELOG.mdand the negative-edge paragraph 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).extract-api --checkpass.DocxSpaceAboveTest(new):2.5-dev: onlyCobaltRotachanges.Qand the subtitle show whole.Known limits
CobaltRota's remaining drift is its outlined chips (1.1pt a row) and its group icons, anchored a row low.Lane: shared-engine (render-docx). No public API change.