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

Fix issue where inset border radius was off when there is a border #45658

Closed
wants to merge 1 commit into from

Conversation

joevilches
Copy link
Contributor

Summary:
The border radius of the inner "clear region" for inset shadows is based off of the border radius of the padding box path (i.e. the shadow path). Notably, this is not the View's given border radius iff there is a border present.

To get this "inner border radius" I added a new method inside of CSSBackgroundDrawable. This logic was already present here, so I tried to share most of the code there. There may be a better way to do this, but this seems to be the quickest.

Reviewed By: NickGerleman

Differential Revision: D60083309

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Jul 25, 2024
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60083309

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60083309

joevilches added a commit to joevilches/react-native that referenced this pull request Jul 25, 2024
…acebook#45658)

Summary:
Pull Request resolved: facebook#45658

The border radius of the inner "clear region" for inset shadows is based off of the border radius of the padding box path (i.e. the shadow path). Notably, this is not the View's given border radius iff there is a border present.

To get this "inner border radius" I added a new method inside of `CSSBackgroundDrawable`. This logic was already present [here](https://www.internalfb.com/code/fbsource/[33e35cbf387a]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java?lines=643-650), so I tried to share most of the code there. There may be a better way to do this, but this seems to be the quickest.

Reviewed By: NickGerleman

Differential Revision: D60083309
joevilches added a commit to joevilches/react-native that referenced this pull request Jul 25, 2024
…acebook#45658)

Summary:
Pull Request resolved: facebook#45658

The border radius of the inner "clear region" for inset shadows is based off of the border radius of the padding box path (i.e. the shadow path). Notably, this is not the View's given border radius iff there is a border present.

To get this "inner border radius" I added a new method inside of `CSSBackgroundDrawable`. This logic was already present [here](https://www.internalfb.com/code/fbsource/[33e35cbf387a]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java?lines=643-650), so I tried to share most of the code there. There may be a better way to do this, but this seems to be the quickest.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60083309
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60083309

1 similar comment
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60083309

joevilches added a commit to joevilches/react-native that referenced this pull request Jul 25, 2024
…acebook#45658)

Summary:
Pull Request resolved: facebook#45658

The border radius of the inner "clear region" for inset shadows is based off of the border radius of the padding box path (i.e. the shadow path). Notably, this is not the View's given border radius iff there is a border present.

To get this "inner border radius" I added a new method inside of `CSSBackgroundDrawable`. This logic was already present [here](https://www.internalfb.com/code/fbsource/[33e35cbf387a]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java?lines=643-650), so I tried to share most of the code there. There may be a better way to do this, but this seems to be the quickest.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60083309
…acebook#45658)

Summary:
Pull Request resolved: facebook#45658

The border radius of the inner "clear region" for inset shadows is based off of the border radius of the padding box path (i.e. the shadow path). Notably, this is not the View's given border radius iff there is a border present.

To get this "inner border radius" I added a new method inside of `CSSBackgroundDrawable`. This logic was already present [here](https://www.internalfb.com/code/fbsource/[33e35cbf387a]/xplat/js/react-native-github/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/drawable/CSSBackgroundDrawable.java?lines=643-650), so I tried to share most of the code there. There may be a better way to do this, but this seems to be the quickest.

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D60083309
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D60083309

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 8fe3ae3.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jul 27, 2024
@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @joevilches in 8fe3ae3

When will my fix make it into a release? | How to file a pick request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants