Skip to content

fix(pptx): apply style-matrix outlines (lnRef) to shapes#322

Merged
developer0hye merged 1 commit into
mainfrom
fix/pptx-lnref-outlines
Jul 18, 2026
Merged

fix(pptx): apply style-matrix outlines (lnRef) to shapes#322
developer0hye merged 1 commit into
mainfrom
fix/pptx-lnref-outlines

Conversation

@developer0hye

Copy link
Copy Markdown
Owner

Summary

Shapes whose outline comes from the style matrix (<p:style><a:lnRef>) rendered with no stroke. Two root causes:

  • The outline width lives in the theme lnStyleLst entry referenced by <a:lnRef idx="N">, which we never parsed — the width defaulted to 0
  • The lnRef scheme color carrying a <a:shade>/<a:tint> transform arrives as a Start event, but only the Empty-event color arm handled the refs, so the color was dropped (same bug class as the text-box shade fix in XLSX: render worksheet text boxes #240)

Fix: parse the theme lnStyleLst widths into ThemeData; capture the lnRef idx and fall back to that width when no explicit <a:ln w> is present; resolve lnRef/fillRef/fontRef colors from Start events too.

Test plan

  • New tests: theme lnStyleLst width parsing; a shape with only a shaded lnRef idx=2 outline resolves both width (theme idx→1pt) and color (accent1 shaded 50%) into a stroke (TDD, red first)
  • Full workspace suite passes; fmt --check clean; clippy -D warnings clean

Visual verification (public shape-text-rotate fixture vs PowerPoint GT, 150 DPI)

GT Before After
gt before after

The pentagon now shows its accent1-shaded outline like PowerPoint (combined with the geometry fix #319 already on main).

Related: #318

🤖 Generated with Claude Code

Shapes whose outline comes from the style matrix rendered without a
stroke. Two causes: the outline width lives in the theme lnStyleLst
referenced by <a:lnRef idx>, which we never parsed; and the lnRef
scheme color carrying a shade/tint transform arrives as a Start event,
which only the Empty-event color arm handled, so the color was dropped
(the same class of bug as the text-box shade fix in #240).

Parse the theme lnStyleLst widths into ThemeData, capture the lnRef
idx, fall back to that width when no explicit <a:ln w> is present, and
resolve lnRef/fillRef/fontRef colors from Start events too.

Related: #318

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
@developer0hye
developer0hye merged commit c409df7 into main Jul 18, 2026
14 checks passed
@developer0hye
developer0hye deleted the fix/pptx-lnref-outlines branch July 18, 2026 10:38
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.

PPTX: pentagon preset geometry renders shorter than its bounding box

1 participant