Skip to content

pptx: connector glued via from=/to= anchors both ends at shape centers (idx=0) — the line crosses through both shapes #177

Description

@FunkyRusher

Version: 1.0.129 (officecli-linux-x64), Ubuntu 26.04.

Summary: a straight connector created with from=/to= shape references writes stCxn/endCxn with idx="0" on both ends and center-to-center geometry. PowerPoint renders the connector exactly as written, so the arrow strikes through the halves of both connected shapes (and through every shape in between when connecting across a row) instead of running edge-to-edge through the gap.

Repro:

officecli create conn.pptx
officecli add conn.pptx / --type slide --prop layout=blank
officecli add conn.pptx "/slide[1]" --type shape --prop preset=roundRect --prop name=L --prop x=2cm --prop y=5cm --prop width=6cm --prop height=4cm --prop text=Left
officecli add conn.pptx "/slide[1]" --type shape --prop preset=roundRect --prop name=R --prop x=10cm --prop y=5cm --prop width=6cm --prop height=4cm --prop text=Right
officecli add conn.pptx "/slide[1]" --type connector --prop "from=/slide[1]/shape[@name=L]" --prop "to=/slide[1]/shape[@name=R]" --prop shape=straight --prop tailEnd=triangle
unzip -p conn.pptx ppt/slides/slide1.xml | tr '<' '\n<' | grep -E "stCxn|endCxn|a:off |a:ext "

Actual (v1.0.129):

a:off x="720000" y="1800000" />    shape L (center = 1800000, 2520000)
a:ext cx="2160000" cy="1440000" />
a:off x="3600000" y="1800000" />   shape R (center = 4680000, 2520000)
a:ext cx="2160000" cy="1440000" />
a:stCxn id="100000" idx="0" />
a:endCxn id="100001" idx="0" />
a:off x="1800000" y="2520000" />   connector: starts at center of L
a:ext cx="2880000" cy="0" />       ...ends at center of R

The connector spans (1800000, 2520000) → (4680000, 2520000), i.e. center of L to center of R: half of each shape is overlapped by the arrow.

Expected: endpoints glued to the facing connection sites — the right-edge site of L and the left-edge site of R (what PowerPoint does when dragging a connector between two shapes), i.e. geometry (2880000, 2520000) → (3600000, 2520000), with matching stCxn/endCxn idx values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions