Repository navigation
Structure tab: draw the full-page screenshot at wireframe size - #64
Open
woutervanwijk wants to merge 2 commits into
Open
woutervanwijk wants to merge 2 commits into
woutervanwijk wants to merge 2 commits into
Conversation
The full-page background was drawn at the capture-time CSS page size times the wireframe scale, while the canvas is the measured layout times the scale. When the two heights disagree (on a phone the page grows during the scroll-through, and the new screenshot can arrive before the re-measured layout), the image was drawn much larger than the wireframe and clipped, so it looked zoomed and misaligned. Draw the background stretched over the whole canvas instead: the canvas is the page, so the screenshot and the blocks always share one coordinate space. Also decode the bitmap downscaled to the wireframe's max width (the wireframe never displays wider), so a full-resolution capture no longer wastes memory. The now-unused fullPageScreenshotCss is removed. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
…t swap The layout script measured only scrollingElement's scroll size while the full-page capture takes max(scrollingElement, body) — on pages where <body> is the taller one the wireframe's page size disagreed with the capture's, so the screenshot and the blocks were drawn in different coordinate spaces. Take the max of both in the layout script too. Also swap the decoded background image and its full-page flag atomically, and drop a stale shot of the other kind immediately, so the old viewport shot is never stretched over the full canvas while the full-page shot decodes. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
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.
The full-page background was drawn at the capture-time CSS page size x wireframe scale, while the canvas is the measured layout x scale. When those heights disagree (on a phone the page grows during scroll-through, and the new screenshot can arrive before the re-measured layout), the image was drawn much larger than the wireframe and clipped — zoomed and misaligned.
Fix: draw the background stretched over the whole canvas, so the screenshot and the blocks always share one coordinate space. The bitmap is also decoded downscaled to the wireframe's max width (it never displays wider). The now-unused fullPageScreenshotCss is removed.
flutter analyze clean, flutter test 1685 pass.