Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Implementation of CGAffineTransform  #428

@filip-sakel

Description

@filip-sakel

Is the implementation of the non-apple CGAffineTransform correct?

Several things seem "off". For one, the implementation of inverted() simply negates the matrix's components. On other implementations, however, such as the Foundation and SwiftWin32 ones, it's much more complex — calculating a determinant, examining if inversion is possible, etc. Furthermore, rotated(by:) — despite claiming to rotate an existing transformation — ignores the translation components of the matrix (tx and ty) and existing scaling and rotation adjustments.

Perhaps, the current return value of rotated(by:) was intended to be appended to self before being returned.

If this is indeed incorrect, I'd be happy to submit a PR to fix it and add a test coverage — although tests in Tokamak seem to cover higher-level rendering behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions