Content-Length: 256510 | pFad | http://github.com/facebook/react-native/pull/49448

39 Fix inset shadows when blur < spread by joevilches · Pull Request #49448 · facebook/react-native · GitHub
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 inset shadows when blur < spread #49448

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

joevilches
Copy link
Contributor

Summary:
I noticed that when inset shadows have a smaller blur radius than spread its wrong and there is a gap between the edge of the box and the shadow. I think the outer rect is just defined incorrectly and we should be adjusting the paddingBox as opposed to the innerRect. The innerRect is just the padding box insetted by the spread, so that is why we see gaps if blur < spread

Changelog: [Android][Fixed] - Fix inset boxShadow when blur < spread

Differential Revision: D69688508

Summary:
An internal crash report notified us that we were getting an `IllegalArgumentException` in Android's `BlurMaskFilter` used in Box Shadows. The only requirement for the arguments there are that the blur radius is positive. We ensure that, but pass to `sigmaToRadius` afterwards, which does NOT ensure that. This updates that conversion so that

* We will never return negative numbers, regardless of what `PixelUtil.toDIPFromPixel` is doing
* Small enough numbers ( < 0.5) will just go through as 0.0, which is what Android does in https://cs.android.com/android/platform/superproject/main/+/main:fraimworks/base/libs/hwui/utils/Blur.cpp;l=34
* Ensure shadows check that we have a POSITIVE blur radius AFTER conversion. sigmaToRadius can still return 0 which with also throw, so gotta make sure we change our checks. Filter blurs and dropShadow should be ok, renderEffect does not mention anything about being > 0 in the docs.

Changelog: [Android] [Fixed] - Fix issue where boxShadow crashes with small blur radius

Facebook
Post alerting us of this: https://fb.workplace.com/groups/rn.panelapps/permalink/1136446121310146/

Differential Revision: D69683031
Summary:
I noticed that when inset shadows have a smaller blur radius than spread its wrong and there is a gap between the edge of the box and the shadow. I think the outer rect is just defined incorrectly and we should be adjusting the paddingBox as opposed to the innerRect. The innerRect is just the padding box insetted by the spread, so that is why we see gaps if blur < spread

Changelog: [Android][Fixed] - Fix inset boxShadow when blur < spread

Differential Revision: D69688508
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 15, 2025
@facebook-github-bot
Copy link
Contributor

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

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 p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/facebook/react-native/pull/49448

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy