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

feat: macos support #63

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

feat: macos support #63

wants to merge 1 commit into from

Conversation

okwasniewski
Copy link
Owner

This PR solves #46

Unresolved issue

The view is not sized properly when using sidebar, it's width is always width of the window.

CleanShot 2024-10-19 at 20 32 34@2x

@okwasniewski
Copy link
Owner Author

cc: @Saadnajmi maybe you know what I've missed to make it work with the sidebar?

I've been also getting these kind of errors, not sure if this is related to RN macOS or my implementation:

CleanShot 2024-10-19 at 20 46 36@2x

Comment on lines +186 to +195
#elseif os(macOS)
let newImage = NSImage(size: size)
newImage.lockFocus()
self.draw(in: CGRect(origin: .zero, size: size),
from: CGRect(origin: .zero, size: self.size),
operation: .copy,
fraction: 1.0)
newImage.unlockFocus()
return newImage
#endif
Copy link
Collaborator

@Saadnajmi Saadnajmi Oct 22, 2024

Choose a reason for hiding this comment

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

Unrelated to the issue you're facing, see a similar change here: microsoft/react-native-macos#2209
lockFocus and that pattern is deprecated in favor of imageWithSize:flipped:drawingHandler:. Similarly, I think UIGraphicsBeginImageContextWithOptions is mostly replaced with UIGraphicsImageRenderer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants