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:
co-authored by
Claude Sonnet 5
parent
bee81187fb
commit
cb0e0acc11
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user