Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make properties of CGPoint, CGSize and CGRect vars instead of lets #382

Merged
merged 1 commit into from
Feb 18, 2021

Conversation

mortenbekditlevsen
Copy link
Contributor

And initialized array used by CGAffineTransform concatenation

…nitialized array used by CGAffineTransform concatenation
@mortenbekditlevsen mortenbekditlevsen added the bug Something isn't working label Feb 17, 2021
@mortenbekditlevsen mortenbekditlevsen requested a review from a team February 17, 2021 12:22
@mortenbekditlevsen
Copy link
Contributor Author

Note:
The rotated(by:) implementation appears to be a copy of the init(rotationAngle:) - it doesn't take the current matrix values into account at all.
Would it suffice to return self.concatenating(Self(rotationAngle: angle)) ?

Copy link
Collaborator

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Long term we should use Foundation types directly instead of our own stubs, but for now this seems legit.

@carson-katri
Copy link
Member

We should probably separate it out to it's own product and do

#if canImport(CoreGraphics)
@_exported import CoreGraphics
#else
...
#endif

since I doubt CG will be available on the web, for instance.

@MaxDesiatov
Copy link
Collaborator

CoreGraphics itself is not available, but all of the types and some of their extensions in CGStubs are already available in Foundation for WASI. I've tried using that instead of our own reimplementation, but that broke some of our Shape SVG rendering. We need to add unit tests to thoroughly cover that area and make the switch. We already link with Foundation for Bundle required by the Image type anyway.

@MaxDesiatov MaxDesiatov changed the title Made properties of CGPoint, CGSize and CGRect vars instead of lets. Make properties of CGPoint, CGSize and CGRect vars instead of lets Feb 17, 2021
@mortenbekditlevsen mortenbekditlevsen merged commit 19cf8b6 into main Feb 18, 2021
@mortenbekditlevsen mortenbekditlevsen deleted the cgstubs_fix branch February 18, 2021 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

3 participants