feat: parse PPTX connector shapes (cxnSp)#167
Merged
developer0hye merged 5 commits intomainfrom Mar 13, 2026
Merged
Conversation
PPTX connector shapes (<p:cxnSp>) were completely ignored by the parser, causing all connecting lines and arrows in diagrams to disappear in the converted PDF output. Key changes: - Recognize <p:cxnSp> elements alongside <p:sp> in the XML event loop - Parse flipH/flipV attributes on <a:xfrm> for correct line direction - Resolve fallback line color from <p:style><a:lnRef> scheme references - Map bent/curved connector presets to straight line approximations Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
- Change ShapeKind::Line to use (x1,y1)-(x2,y2) start/end points so flipped lines render within their bounding box correctly - Add ShapeKind::Polyline for multi-segment bent connectors - Add ArrowHead enum and parse <a:tailEnd>/<a:headEnd> from <a:ln> - Render triangle arrowheads as filled polygons at line endpoints - Map bentConnector2-5 to proper Z-shaped polyline paths with adjustable bend points from <a:avLst><a:gd> values - Render polylines as consecutive #line() segments in Typst Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Arrowhead polygons and polyline line segments were rendered sequentially inside a #place() block, causing Typst to stack them vertically instead of overlaying at the correct coordinates. Wrap each #polygon() and #line() segment in #place(top + left)[...] so they overlay correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Collapse nested if-let chain in adj value parsing, suppress too_many_arguments for test helper, and apply rustfmt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Yonghye Kwon <developer.0hye@gmail.com>
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
<p:cxnSp>(connector shape) elements that were previously completely ignored, causing all connecting lines and arrows in PPTX diagrams to disappearflipH/flipV— uses(x1,y1)→(x2,y2)start/end points within the bounding box instead of negative coordinates<a:tailEnd>/<a:headEnd>from<a:ln>and render as filled polygon triangles, overlaid with#place()for correct positioningbentConnector2-5render as proper Z-shaped multi-segment paths with adjustable bend points from<a:avLst><p:style><a:lnRef>scheme references when connectors don't have explicit fillsKey changes
ir/elements.rs:ShapeKind::Linenow hasx1,y1,x2,y2+ arrowheads; newShapeKind::PolylineandArrowHeadenumparser/pptx_slides.rs: Recognize<p:cxnSp>, parse flips/arrowheads/adj values/style colorsparser/pptx_shapes.rs: Connector geometry helpers (line endpoints, bent connector points)render/typst_gen_shapes.rs: Polyline rendering + arrowhead triangle generation with#place()overlayTest plan
🤖 Generated with Claude Code