fix: address code review findings from crop/text commit

- Fix crop confirm anchor drift for rotated images by using crop corner
  world point instead of AABB min in useCanvasSetup.ts
- Document ungroup shear limitation for non-uniform scale + rotation
- Add 6 integration tests covering crop confirm and ungroup paths
This commit is contained in:
Hiren Kangad
2026-03-13 13:47:14 +05:30
parent 9a4edd90c7
commit 21a724c0f4
3 changed files with 160 additions and 5 deletions
+6 -1
View File
@@ -145,7 +145,12 @@ export function ungroupItems(
{ x: groupX, y: groupY, sx: groupSx, sy: groupSy, angle: groupAngle },
);
// Propagate group scale and angle
// Propagate group scale and angle.
// NOTE: This decomposition (multiply scales, add angles) is only exact for
// uniform group scaling or axis-aligned children. Non-uniform group scale
// combined with a rotated child produces shear that cannot be represented
// by sx/sy + angle alone. In practice groups are rarely non-uniformly
// scaled, so this is an acceptable limitation.
imgData.sx *= groupSx;
imgData.sy *= groupSy;
imgData.angle = (imgData.angle || 0) + groupAngle;