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
+1
View File
@@ -26,6 +26,7 @@
<div class="canvas-wrap">
<canvas id="canvas"></canvas>
</div>
<p class="pan-hint" id="pan-hint" hidden>Drag the photo to reposition the crop</p>
<div class="controls">
<div class="control-group">