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

Add cornerCurve option to SurfaceAppearance #417

Merged
merged 5 commits into from
Jan 5, 2021
Merged

Add cornerCurve option to SurfaceAppearance #417

merged 5 commits into from
Jan 5, 2021

Conversation

zntfdr
Copy link
Contributor

@zntfdr zntfdr commented Dec 19, 2020

This PR adds support to customize the cornerCurve of the containerView

Screen.Recording.2020-12-19.at.11.23.44.AM.mov

I might be wrong, but it seems like the mask is not following the SurfaceAppearance's cornerCurve, initially this was because updateShadow() was called before updateCornerRadius(), but even after changing that the shadow seems to not adjust to the new cornerCurve. Any lead would be very welcome!

Also, I'm more than happy to close this PR if this can already be achieved in other ways, thank you :)

@scenee
Copy link
Owner

scenee commented Dec 22, 2020

I agree with adding the new options! This is a point I was unable to make a decision to do it.
As you mentioned, we need to change the shadow path for the circular corners because UIBezierPath(roundedRect:..) API always use the continuous corners. So I would like to push a commit to update the shadow path. Should I create a feature branch to merge your PR?

@zntfdr
Copy link
Contributor Author

zntfdr commented Dec 22, 2020

Thank you @scenee ❤️

So I would like to push a commit to update the shadow path. Should I create a feature branch to merge your PR?

Please feel free to use this branch: as a maintainer you can push commits directly here 😃

@scenee
Copy link
Owner

scenee commented Dec 25, 2020

I've added a commit to fix the shadow and its mask for circular corners.
https://user-images.githubusercontent.com/899487/103136760-87e15700-4706-11eb-955e-2e7406877e10.mov

@zntfdr zntfdr marked this pull request as ready for review December 26, 2020 08:35
@zntfdr
Copy link
Contributor Author

zntfdr commented Dec 26, 2020

Thank you @scenee 🙏🏻

@scenee
Copy link
Owner

scenee commented Dec 28, 2020

@zntfdr, thank you too! We made a nice improvement 👍

@scenee scenee merged commit be0ebd0 into scenee:master Jan 5, 2021
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