Skip to content

Fix: divide by the determinant in CATransform3DInvert - #13

Merged
ivucica merged 1 commit into
gnustep:masterfrom
DTW-Thalion:fix/catransform3d-invert-determinant
Jul 29, 2026
Merged

Fix: divide by the determinant in CATransform3DInvert#13
ivucica merged 1 commit into
gnustep:masterfrom
DTW-Thalion:fix/catransform3d-invert-determinant

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

CATransform3DInvert computed the adjugate of the matrix but never divided by the determinant, so it returned the adjugate rather than the inverse: inverting CATransform3DMakeScale(2, 2, 2) gave a diagonal of 4, 4, 4, 8 instead of 0.5, 0.5, 0.5, 1. Divide each element by the determinant.

This makes the hopeful assertion in the CATransform3D tests (#12) pass. Checked against Apple QuartzCore on a macOS runner.

@ivucica ivucica left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ivucica
ivucica merged commit 6ce6b7d into gnustep:master Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants