fix(pptx): render master/layout, parametric presets, and bulleted lists faithfully#54
Merged
Merged
Conversation
…ts faithfully Tightens the PPTX importer + canvas across a batch of fidelity issues surfaced while importing the KBC sample deck: - Honour `showMasterSp="0"` on slide/layout; clip the canvas to slide bounds so master bleed-area trim no longer leaks in. - Synthesise SVG paths for arc, chevron/homePlate/pentagon, cube, and ellipse/circle presets (incl. flipH/flipV). Attach as `backingPath` on text-bearing variants so the silhouette survives the isText branch. - Apply the inscribed `txRect` for chevron/pentagon so long labels wrap inside the polygon body, not the bounding rectangle. - Per-paragraph `marL`/`indent`/`algn`/`spcBef` on TextElement → PowerPoint-style hanging-indent bullets with authored spacing. Restore `<a:br/>` when raw XML isn't preserved. Resolve `<a:fld type="slidenum">` to the slide's index. - Read `<a:prstDash>` on shape strokes and parse `<a:fillToRect>` literal-percent attributes (`"0%"`/`"100%"`) so radial gradients land at the right focus. - Apply `flipH` to connectors and `prst="line"` / `straightConnector1` shapes so diagonal struts (e.g. the 7-S diagram) draw the correct direction.
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.
Summary
Batch of PPTX import fidelity fixes surfaced while importing the KBC sample deck. Each issue is a real divergence from PowerPoint's rendering, not a cosmetic preference.
Master / canvas
showMasterSp="0"on<p:sld>/<p:sldLayout>so master decorations don't leak onto title slides that opt out.1920×1080rect — slide-master trim is routinely positioned outside the slide bounds (y=-46px,x=-40px) as bleed marks and would otherwise sit on top of the slide.Parametric preset shapes
arc,chevron/homePlate/pentagon,cube, andellipse/circle. Each respectsflipH/flipVbaked into the path coordinates.<p:txBody>with content), attach the synthesised path as the text element'sbackingPathso the silhouette survives the isText short-circuit. Fixes the 7-S diagram's central oval, process-bar chevrons, and 3D-cube grids.txRectfor chevron/homePlate/pentagon so long labels wrap inside the polygon body, not the bounding rectangle. Stops icon-column overlap in process bars.Bullets and paragraphs
marL/indent/algn/<a:spcBef>onTextElementand render each paragraph in its own block. Hanging-indent bullets now wrap under the text-after-bullet column instead of collapsing to column 0;spcBefproduces the authored vertical air between items.<a:br/>in paragraphs whose raw XML wasn't preserved — previously"FOO" <br/> "BAR"could collapse into"FOOBAR".<a:fld type="slidenum">to the slide's 1-based index (was rendering the literal‹#›design-time token).Stroke and fill
<a:prstDash>(dot,dash,dashDot, …) on shape strokes and emitborder-style/stroke-dasharray. Previously only line-element connectors honoured dashes.<a:fillToRect>attributes in their literal-percent form ("0%"/"100%"). PowerPoint emits both that and 1000ths-of-percent integers;Number("0%") = NaNwas collapsing radial gradient focus points to0% 0%.Connectors
flipHto<p:cxnSp>and<p:sp prst="line" / "straightConnector1">. OnlyflipVwas honoured before, so flipped-diagonal struts (e.g. 7-S model) drew the wrong way.Test plan
marL/indentsurvive.