Skip to content

Write connector EMU coordinates as integers - #1143

Open
DSeaStar wants to merge 1 commit into
scanny:masterfrom
DSeaStar:fix-connector-integer-emus
Open

Write connector EMU coordinates as integers#1143
DSeaStar wants to merge 1 commit into
scanny:masterfrom
DSeaStar:fix-connector-integer-emus

Conversation

@DSeaStar

Copy link
Copy Markdown

Fixes #1058.

add_connector() writes a:off / a:ext by interpolating the computed EMUs into XML. Those values are often floats in real use (shape.height / 2, mixed Inches arithmetic), and OOXML requires integer coordinates. The resulting x="123.5" files open in some viewers but PowerPoint and Google Slides reject them.

Steve suggested coercing at the write site (int(x) / int(y) / int(cx) / int(cy)). That matches how pictures already emit %%d. Existing integer cases are unchanged; a float case is added to the _add_cxnSp fixture.

OOXML a:off/a:ext attributes are integers. add_connector() often receives
floats (for example shape.height / 2), which were interpolated into XML
and produced files PowerPoint and Google Slides reject.
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.

Generating corrupted PPT when using connectors

1 participant