Uh oh!
There was an error while loading. Please reload this page.
Fix inconsistent shadows - #1352
Conversation
Lynn Zhang (lyzhan7)
commented
Aug 10, 2022
Note: We tried an additional approach to fix this, since the root issue behind this bug is that modifying certain layer props (including shadow related ones) on a layer owned by an NSView is undefined behavior, and we are still doing this in RCTViewManager with RCT_REMAP_VIEW_PROPERTY In the second approach, rather than modifying RCTView.m, we changed RCTViewManager.m to use RCT_CUSTOM_VIEW_PROPERTY instead of RCT_REMAP_VIEW_PROPERTY, and set the view.shadow there. We decided to keep the original approach since the result is the same, it's simpler and there will be less diffs between React Native macOS and React Native Core. If there are further issues with shadow rendering consistency this could be something we revisit. |
Pull Request Analyser (pull-bot)
commented
Aug 10, 2022
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Code Analyser (analysis-bot)
commented
Aug 11, 2022
Base commit: e532f86 |

Please select one of the following
Summary
Pull request #1227 mostly fixed the consistency issue but had a problem with the shadow opacity. There isn't a shadowOpacity property on NSShadow, the shadow opacity from the layer needed to be passed into the alpha channel of the NSShadow shadowColor property.
Fixes#824
Test Plan
This fix was tested with the fluentui-react-native tester app.
Before:
before.mov
After:
afteropacityfix.mov