Repository navigation
Studio: crop/reposition the input on the render, output-format pages with masked margins - #33
Merged
Merged
Conversation
Zoom in on the interesting part of a picture or video by manipulating it right on the stage: drag to move, wheel (or trackpad pinch, arriving as ctrl+wheel) to zoom on the cursor, alt/option+wheel to rotate, double-click to reset — on touch, two fingers drag/pinch/twist (with quarter-turn snap) while one finger keeps scrolling the page. The view transform (new pure module src/lib/rstr2/viewTransform.ts, unit tested) is applied where source pixels are extracted, so segmentation, hatching, preview, SVG/PNG exports, ordering and the video sequence export all see only the reframed picture; off-frame area reads as bare paper. A video keeps one framing across scrubbing and all exported frames. While a gesture is in flight the stage shows the reframed source with a rule-of-thirds grid (the hatch render is too slow to follow live), and a "full image" chip with a zoom/angle readout offers the way back. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XzVKNfUqWxgWRD4A4RYDx
… border The A6-A3 buttons become toggles (at most one active, off by default), a picker adds more sizes - A2-A0, B-series, US letter/legal/tabloid, squares, AxiDraw beds - plus a custom width x height, and named sheets auto-turn to match the input with a manual flip. While a format is active the working frame takes the page's aspect, the crop view composes the input into it (starting from the whole image fitted inside the margins), exports become exactly that page, and the margin acts as a mask: hatch segments are clipped so no ink lands within it, previewed as a dimmed band while reframing. Order sizing uses the drawn extent inside the mask. Output width and margin are now the user's own settings: presets, imports and dice rolls no longer touch them (values in stored presets are ignored), and a new input resets the format while keeping the width. The crop preview also gains an accent border along the input's own edge, so where it starts and ends stays visible on inputs with white backgrounds. New pure modules: outputFormat.ts (catalog, orientation, margin math) and clipSegmentsToRect in hatchTools.ts; containView and source-vs-frame clamping in viewTransform.ts - all unit tested. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XzVKNfUqWxgWRD4A4RYDx
… space The render surfaces only ever scaled down (max-width/height: 100%), so a small input sat at its native pixel size in a sea of empty stage. The stage is now a size container and every render surface contain-fits its content box via cqw/cqh, upscaling small sources as well. Sizing the element itself (height keeps the intrinsic ratio) rather than object-fit letterboxing keeps the element box equal to the visible render, so the paper shadow and the crop gestures' client-to-frame mapping stay exact; older browsers without container units keep the previous behavior. Also refreshes the unsupported-order note that still pointed at the removed "fit on page". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XzVKNfUqWxgWRD4A4RYDx
The bold titles in the numbered legend now link to their sections, using the site's dashed link style for affordance. On desktop (>= 1200px) a fixed "on this page" panel sits beside the content column listing every section - the eight studio ones with their screenshot number and color, plus overview, prep, classic and good to know - with a small scroll spy highlighting where the reader is. Sections got stable anchor ids, land just below the sticky top bar (scroll-margin), and anchor jumps scroll smoothly unless the reader prefers reduced motion. The legend and panel are generated from one section table, so titles, numbers and colors can no longer drift apart. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XzVKNfUqWxgWRD4A4RYDx
The panel and scroll spy follow document order, and the presets section sat after layers — so the panel counted ...4, 6, 5, 7... Move the presets section ahead of layers (matching the studio's own right-pane order), and every view of the page — panel, legend, reading order — now counts 1 through 8. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012XzVKNfUqWxgWRD4A4RYDx
Deploying rstr with
|
| Latest commit: |
fdadc29
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ed7fb338.rstr.pages.dev |
| Branch Preview URL: | https://claude-studio-crop-repositio.rstr.pages.dev |
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.
Zoom in on the interesting part of a picture or video by manipulating it right on the render, and compose it onto a fixed page whose margin is masked.
Crop / reposition (
498f11c,e63b4bd)Output formats (
16b6b54)210.00mm × 297.00mm).Help page (
cb244bf,fdadc29)Engine additions
Pure, unit-tested modules in
src/lib/rstr2/:viewTransform.ts(gesture/matrix math, contain fit, clamping),outputFormat.ts(format catalog, orientation, margin math),clipSegmentsToRectinhatchTools.ts.Testing
svelte-checkand lint clean.🤖 Generated with Claude Code
https://claude.ai/code/session_012XzVKNfUqWxgWRD4A4RYDx
Generated by Claude Code