mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix issue where filter layer was not the same shape as the underlying layer (#46138)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46138 jorge-cab noticed that filters on iOS do not fit the shape of the layer if we have rounded corners. Fix is pretty straight forward. Changelog: [Internal] Reviewed By: NickGerleman Differential Revision: D61612655 fbshipit-source-id: 91785ed10a039e031c5440bde131c1583ba3992a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9bfbf948df
commit
5bb4ef5dec
+7
@@ -855,6 +855,13 @@ static RCTBorderStyle RCTBorderStyleFromBorderStyle(BorderStyle borderStyle)
|
||||
blue:multiplicativeBrightness
|
||||
alpha:self.layer.opacity]
|
||||
.CGColor;
|
||||
if (borderMetrics.borderRadii.isUniform()) {
|
||||
_filterLayer.cornerRadius = borderMetrics.borderRadii.topLeft;
|
||||
} else {
|
||||
RCTCornerInsets cornerInsets =
|
||||
RCTGetCornerInsets(RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii), UIEdgeInsetsZero);
|
||||
_filterLayer.mask = [self createMaskLayer:self.bounds cornerInsets:cornerInsets];
|
||||
}
|
||||
// So that this layer is always above any potential sublayers this view may
|
||||
// add
|
||||
_filterLayer.zPosition = CGFLOAT_MAX;
|
||||
|
||||
Reference in New Issue
Block a user