Add drag-to-reposition for aggressive crops
Docker / build-and-push (push) Successful in 4m34s

Non-original aspects (square, 4:5, 16:9) always centered the crop with
no way to choose what got cut off. Crop position is now a normalized
0-1 offset per axis instead of a fixed /2 center, and dragging directly
on the canvas -- only when the current aspect actually leaves slack to
pan within -- adjusts it. Pointer movement converts to rotated-image
pixels via the crop-width-to-display-width ratio, so it stays 1:1
regardless of the maxDim downscale or the canvas's own CSS scaling.
Resets to centered on aspect or rotation change, since old offsets
don't make sense against new dimensions. Verified with a real drag test:
a marker cropped out at the centered default becomes visible after
dragging, and the "original" aspect (no crop, no slack) correctly
leaves panning disabled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Fredrik Johansson
2026-08-07 17:29:38 +02:00
co-authored by Claude Sonnet 5
parent bee81187fb
commit cb0e0acc11
3 changed files with 100 additions and 2 deletions
+11
View File
@@ -128,6 +128,17 @@ p { margin: 0; }
max-width: 100%;
max-height: 60vh;
display: block;
touch-action: none;
}
#canvas.pannable { cursor: grab; }
#canvas.pannable.panning { cursor: grabbing; }
.pan-hint {
text-align: center;
font-size: 12px;
color: var(--text-dim);
margin: -12px 0 20px;
}
/* ── Controls ───────────────────────────────────────────────────────── */