Repository navigation
fix: undo the stored rotation of a singly flipped .ppt shape - #2411
mahesh-desu wants to merge 1 commit into
Conversation
…ld#2407) Signed-off-by: MaheshDesu <mahesh.desu3@gmail.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Legacy
.pptshapes that are rotated and flipped in one direction now import at the angle they have in the source.Fixes #2407.
What the user saw. A shape rotated 30° and flipped horizontally imported as 330° (
rot="19800000"instead ofrot="1800000"); a 90° shape imported as 270°. The shapes turned the wrong way, so rounded corners and arrows landed on the wrong side. Unflipped shapes and shapes flipped both ways were correct.Cause. A
.pptstores the angle of a shape with exactly one flip as360° - θ.xfrmincrates/ppt/src/convert.rscopied that stored angle intoa:xfrm rotunchanged. The box-swap decision was already right because the mirrored quadrants map onto each other.What changed.
xfrmkeeps the box-swap decision on the stored angle, then returns(360° - stored_rot).rem_euclid(360.0)when exactly one offlip_h/flip_vis set. Both flips, no flip and the finite/rem_euclid handling are unchanged. The.pptreader, the.pptxwriter and the editor's flip behaviour (#901) are untouched.Test.
a_single_flip_mirrors_the_stored_legacy_rotation_backdrivesxfrmwith a 30°/330° pair, both single flips, both-flip and no-flip controls, a 270°/90° box swap, the 360°/-30° wrap, and a non-identity group map. It fails on the base withrot = 330.0for the first case and passes after the fix. No full-import duplicate was added becausexfrmis the only changed branch.Verification.
cargo fmt --all --check— passed.cargo clippy -p deckcraft-ppt --all-targets -- -D warnings— passed.cargo test -p deckcraft-ppt— 52 passed, 0 failed..pptfixture — not run; the unit test drives the only changed branch.The expected angles come from the legacy drawing format, not from a value we chose.
Summary by CodeRabbit