fix(php-transformer): fit slideshow slides into the recovered stage box - #1867
Merged
Merged
Conversation
The recovered box assumed each centered layer covered the stage, so it took the smallest layer on each axis and cropped. Measuring the source shows the opposite: the layers are fitted inside the box and centred, so a portrait slide is letterboxed rather than cropped. Take the largest layer on each axis, which reconstructs the box to within half a percent, fit slides with object-fit contain, and bound the stage to its authored width so it stops stretching to the content column.
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.
Problem
#1858 recovered the stage box a slideshow framed its slides into, but inferred the wrong fit. It assumed each centered layer covered the box, so it took the smallest layer on each axis and cropped with
object-fit: cover.Measuring the source directly shows the opposite. For a stage whose real box is
885x590:The layers are fitted inside the box and centred — a portrait slide is letterboxed, not cropped. So the box is the largest layer on each axis, not the smallest:
886x592against a measured885x590, inside half a percent.The shipped inference produced a portrait
393/588frame that cropped every landscape slide, and the stage also stretched to the full content column instead of its authored width.Change
object-fit: contain, centred, so any orientation keeps one steady frame.stageMaxWidth) and centre it, instead of filling the column.Test
php tests/unit/authored-carousel-block.phpcovers the recovered ratio and width, the emitted custom properties, the fitting stylesheet, declared-pixel-height precedence, and the uncentered-offset rejection. Fullcomposer testpasses locally, including all 311 parity fixtures.AI assistance disclosure
Implemented with AI assistance — grok-4.6 via OpenCode. The correction came from measuring the live source's clip box and per-slide layer boxes against both fit models. A human retains review and merge authority.