Skip to content

fix(docx): hold a composed chip's row less the borders both editors draw outside it - #800

Merged
DemchaAV merged 2 commits into
2.5-devfrom
fix/docx-rota-outlined-chips
Oct 1, 2026
Merged

DemchaAV merged 2 commits into
2.5-devfrom
fix/docx-rota-outlined-chips

Conversation

@DemchaAV

@DemchaAV DemchaAV commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

Why

CobaltRota's staff rows each stood up to 1.1pt taller in Word than on the page, and its last row 6.5pt low.

  • A shape composed in a table cell (a chip) is written as a one-cell table. Its row is held at least the outline's height, less the cell's margins and the heavier border (holdRowAtLeast).
  • Both editors draw a cell's top and bottom borders outside that height. A 9.2pt chip outlined with a 1.125pt border measured 10.3pt in Word and 10.2pt in LibreOffice.
  • Every staff row holding a stacked outlined chip grew by that border.

What changed

  • writePanelPiece. The borders drawn outside the row's height (bordersOutside) are now computed once, before the two branches that hold a panel's row, and the composed-outline branch takes them off as the placed-panel branch already did.
    • The amount is the part of the top border no space above took, plus the bottom border, less the heavier of the two, which holdRowAtLeast already takes off.
    • Where the padding holds the top border, nothing comes off.
  • verticalMargins Javadoc. It now says the other border of a panel's own cell comes off in writePanelPiece, where its padding does not hold its top border.
  • Docs. CHANGELOG.md, the composed-shape paragraph of docs/recipes/docx-export.md, and the composed-cell sentence of docs/architecture/backend-capability-matrix.md.

Verification

  • Full reactor gate: ./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 -am gives BUILD SUCCESS (1791 + 127 tests).
    • render-docx runs 737 tests.
    • After install, examples run 93 green.
    • The knowledge checks pass.
  • DocxComposedCellTest.anOutlinedChipHoldsItsRowLessBothBorders (new).
    • A 9.2pt chip with a 1.125pt border holds its row at 139 twips.
    • The same chip with no border holds it at its outline's 184.
    • Holding the outline's height as before fails it: 161.
  • Template corpus (62 documents), against 2.5-dev: only CobaltRota changes. It stays one page.
    • Word: p90 drift 6.41pt → 2.91, lines more than 2pt off 42 → 37. Its last staff row stands 2.35pt low instead of 6.55.
    • LibreOffice: p90 drift 7.26pt → 3.86.
    • An outlined chip now measures 9.48pt in Word against the page's 9.18. Its label's line, cut no deeper than its letters allow, sets the rest.

Known limits

  • An outlined chip with padding at least as wide as its border is left as before. None in the templates was measured.
  • A block after an outlined chip in the same cell is still drawn up by the chip's bottom border, as after a placed panel. Not drawing it up measured worse on a placed panel (ObsidianInvoice, Word median 0.25pt → 0.49), and no template places a block under a chip.
  • Each staff row still stands 0.1–0.3pt taller than the page's. That comes from the hairline paragraphs closing each nested table, and is a separate change.

Lane: shared-engine (render-docx). No public API change.

@DemchaAV
DemchaAV merged commit 7354a50 into 2.5-dev Oct 1, 2026
12 checks passed
@DemchaAV
DemchaAV deleted the fix/docx-rota-outlined-chips branch October 1, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant