Repository navigation
fix(docx): keep a panel's padding round its outline - #925
Merged
Merged
Conversation
The page sets a shape container's padding round its outline and its layers in the outline itself. Written as a panel in a table cell, the padding was the cell's margins, inside the outline: measured in Word and LibreOffice, a 10pt padding stood the fill 10pt left of the page's and a top-left label 9pt low. The padding is now written as a margin is, the table's indent and the space above and below it, the cell's margins as for no padding, and the panel's width counts it beside the outline. Both editors set a cell's content at its middle or foot without the paragraph closing the cell after a table. Where the shape's table ends its cell in a row held at the page's height, a centred cell takes the space below off the space above; what it cannot, and the space below in a cell set at its foot, is named on the shape.
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
The page sets a shape container's padding round its outline: it measures it as outline plus
padding, draws the outline in from the padding, and sets the layers in the outline itself
(
ShapeContainerDefinition). Written as a panel in a table cell, the padding was the panel cell'smargins, inside the outline.
Measured in Word 16 and LibreOffice on Windows, a 100×60pt shape in an 80pt row:
TOP_LEFTBOTTOM_RIGHTCENTERNone of it was named. The point left over vertically is Word's own: "Before", above the table,
stands 0.9pt higher too.
What changed
writePanelPiece: a shape's padding is added to its margin and written as a margin is:The panel's cell margins are written as for no padding.
panelWidthcounts the padding beside the outline, so a padded shape is held inside itscell.
roomInItsPanelis the outline's width, where the page sets the layers.setDownItsCell: both editors set a cell's content at its middle or its foot without theparagraph that closes the cell after a table, its space below included. Measured with 10pt above
and below:
Where the shape's table ends its composed cell (
endsItsComposedCell: the cell's node, or thelast child down unpainted sections, containers, alignments and stacks of one layer), in a row the
layout holds at the page's height, a centred cell takes the space below off the space above.
What it cannot take, and the space below in a cell set at its foot, is named on the shape
(APPROXIMATED): it stands that much lower.
writeCellContentrecords the composed cell's node and its anchor down the row(
composedCellContent,composedCellDown), or the top where the layout does not hold the row.Docs:
paddingandmarginentries ofDocxNodeFieldLedgerTestfor the shape container;Verification
an unpadded chip's do in the same column (+1pt); before, they stood 1pt left of it.
and after.
identical. The 123 shape containers composed in table cells have no padding and no margin.
DocxPanelPaddingTest(new, 10 tests):DocxComposedCellTest:aPaddedChipsLabelIsSeatedInItsOutline, andaPaddedChipsLabelItsOutlineHoldsIsSeatedOnTheOutlinesMiddle, whose line is now the 15.3ptits borders leave;
DocxPanelTailTest:aPaddedShapeHoldsItsOutlineLessBothBordersandaShapesHangingLineIsHeldInItsOutline;DocxPanelLayerAlignTest:aPaddedShapesLayerIsHeldInItsOutline../mvnw -B -ntp clean verify: BUILD SUCCESS (core 821, render-docx 1841, examples 93, qa 1820).The knowledge pack's
--checkpasses.Lane: render-docx (semantic backend). DOCX output changes only for a shape container with
padding composed in a table cell.