fix: CRITICAL - prevent image clipping when rotating

When rotating images, the rotated corners extend beyond the original canvas
bounds, causing the image to be clipped and appear skewed.

Fixed by:
1. Calculate canvas size needed to fit rotated image
2. Use formula: newSize = sqrt((w*cos)^2 + (h*sin)^2)
3. Center image and rotate around center of new canvas
4. Update cropBounds to new canvas dimensions

Now when user rotates an image, the full rotated result is saved without
any clipping or skewing. The saved image dimensions will be larger than
the original to accommodate the rotation.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-04-22 14:19:20 +03:00
parent 8bcbf4a4a8
commit 743f377357
2 changed files with 21 additions and 15 deletions

File diff suppressed because one or more lines are too long