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

[Uno] Default Opaque to false for SKXamlCanvas on MacOS and iOS #2398

Merged
merged 2 commits into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public partial class SKXamlCanvas
public SKXamlCanvas()
{
Initialize();
#if MACOS
Opaque = false;
#endif
Comment on lines +23 to +25
Copy link
Contributor

Choose a reason for hiding this comment

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

This is actually incorrect for macOS. There is no Opaque property, but rather IsOpaque. However, this other property is read only and according to the docs you should override the property to return the value you want:

The default value of this property is false to reflect the fact that views do no drawing by default. Subclasses can override this property and return true to indicate that the view completely covers its frame rectangle with opaque content. Doing so can improve performance during drawing operations by eliminating the need to render content behind the view.
https://developer.apple.com/documentation/appkit/nsview/1483558-isopaque

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed in #2477

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops sorry about that ! I thought I tested it :/

}

partial void DoLoaded() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ public partial class SKXamlCanvas

public SKXamlCanvas()
{
Initialize();
Initialize();
#if IOS
Opaque = false;
#endif
}

partial void DoLoaded() =>
Expand Down