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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user