Repository navigation
fix(pptx): center resized slide content in pixel coordinates - #86
Conversation
commit: |
ChristopherVR
left a comment
There was a problem hiding this comment.
Thanks, this is a real bug and the fix is in the right place.
Element frames are in pixels but the centring offsets were in EMU, so Ensure Fit and Maximize pushed content far off the slide. Every binding goes through the shared scaleSlidesForSizeChange, so converting the offsets once in resolveSlideSizeRescaleTransform covers all five, and nothing else in the repository depended on EMU offsets. The tests are good: the portrait cases, the save-and-reload round trip on a real deck and the cross-binding browser spec.
Two small requests before merge:
- Please drop
docs/bug-repros/pptx-slide-size-centering.png. It starts a new folder of PR screenshots in the repository; the image is better kept in the PR description. resolveSlideSizeRescaleTransformis exported (ooxml-core/pptx/editor, re-exported fromooxml-ui/pptx) and its offsets change from EMU to pixels. A line in the commit body saying so would help any outside caller.
The exported resolveSlideSizeRescaleTransform now returns offsetX and offsetY in pixels instead of EMU, matching slide element frame coordinates.
9819b26 to
4e0c49b
Compare
|
Thanks for the review, @ChristopherVR! Updated in 4e0c49b: removed the PNG from the commit and moved it to GitHub attachments in the PR and issue descriptions. The commit body now explicitly documents that The |
What does this change?
Fixes #85.
Convert the shared slide-size centering offsets from EMU to pixels before applying them to element frames. Ensure Fit and Maximize now keep content correctly positioned in all five framework bindings, including after saving and reopening.
Type of change
Area
src/core/pptx/editor/render: one DOM-free fix shared by every binding.Testing
bun run verify --base 260a953eabdd657fb744b8c4881d03f51da27a45: all 21 steps passed, including affected core/UI tests, builds, typechecks and viewer suites with React 18 compatibility.9819b2661a322f42d9774f9602fb7d4bb0d71612withscope=changed.Screenshots / recordings
Reproduction PPTX
Summary by CodeRabbit
Bug Fixes
Tests