Skip to content

Structure tab: align the full-page screenshot with the wireframe - #65

Merged
woutervanwijk merged 2 commits into
mainfrom
claude/structure-view-alignment-69a269
Nov 25, 2026
Merged

woutervanwijk merged 2 commits into
mainfrom
claude/structure-view-alignment-69a269

Conversation

@woutervanwijk

Copy link
Copy Markdown
Owner

Problem

On phones (and in a small macOS window) the full-page screenshot in the Structure tab was zoomed about 1.7x and did not line up with the wireframe blocks.

Causes

  • The stitch asked the GPU for an image of shot-width x page-height. On a long page that exceeds the texture limit, and the engine crops the result to the top-left corner instead of scaling it. The stitched image is now scaled down as a whole to at most 8192 px on its longest side.
  • The snapshot is the web view's own bounds, which can be shorter than window.innerHeight (421 vs 515 CSS px in the macOS repro). Stepping by innerHeight skipped content and stretched each slice. The step and slot height now come from the first shot's aspect ratio.
  • The painter draws the screenshot viewport-wide at its own aspect ratio, with the same scale as the blocks, instead of stretching it over the whole canvas.

Testing

  • New stitch test: a very tall page is scaled down whole, not cropped. New painter test for the background rect.
  • Reproduced in a phone-sized macOS window on duic.nl; confirmed on a phone.

🤖 Generated with Claude Code

woutervanwijk and others added 2 commits November 24, 2026 23:53
The screenshot is only as wide as the viewport, but the wireframe canvas
is as wide as the document, which on mobile often overflows the
viewport. Stretching the image over the whole canvas skewed it against
the structure lines. Draw it viewport-wide with its own aspect ratio at
the wireframe's scale instead, for both the first-screen and full-page
shots.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…crop

The stitch asked the GPU for an image of shot-width x page-height, which
on a long page exceeds the texture limit. The engine then cropped the
result to the top-left corner instead of scaling it, so the screenshot
looked zoomed (~1.7x) against the structure wireframe. Scale the whole
image down to at most 8192 px on its longest side.

Also derive how much page one shot covers from the shot's own aspect
ratio: the snapshot is the web view's bounds, which can be shorter than
window.innerHeight, so stepping by innerHeight skipped content and
stretched each slice.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@woutervanwijk
woutervanwijk merged commit 270b0e1 into main Nov 25, 2026
1 check passed
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.

1 participant