Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ - (instancetype)initWithFrame:(CGRect)frame
_props = defaultProps;

_imageView = [RCTUIImageViewAnimated new];
_imageView.clipsToBounds = YES;
// Note(Discord/Hanno): This should not be needed as the JS layer sets overflow:hidden!
// _imageView.clipsToBounds = YES;
_imageView.contentMode = RCTContentModeFromImageResizeMode(defaultProps->resizeMode);
_imageView.layer.minificationFilter = kCAFilterTrilinear;
_imageView.layer.magnificationFilter = kCAFilterTrilinear;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1078,13 +1078,17 @@ - (void)invalidateLayer

for (UIView *subview in self.currentContainerView.subviews) {
if ([subview isKindOfClass:[UIImageView class]]) {
RCTCornerInsets cornerInsets = RCTGetCornerInsets(
RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii),
RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths));

// If the subview is an image view, we have to apply the mask directly to the image view's layer,
// otherwise the image might overflow with the border radius.
subview.layer.mask = [self createMaskLayer:subview.bounds cornerInsets:cornerInsets];
// Note(Discord/Hanno): The parent already applies the mask/clipping so this should be unnecessary.
// It has shown to cause CPU spikes + rendering hitches as this starts to cause offscreen draw passes in the render server.
//
// RCTCornerInsets cornerInsets = RCTGetCornerInsets(
// RCTCornerRadiiFromBorderRadii(borderMetrics.borderRadii),
// RCTUIEdgeInsetsFromEdgeInsets(borderMetrics.borderWidths));

// // If the subview is an image view, we have to apply the mask directly to the image view's layer,
// // otherwise the image might overflow with the border radius.
// subview.layer.mask = [self createMaskLayer:subview.bounds cornerInsets:cornerInsets];
subview.layer.mask = nil;
}
}
} else if (
Expand Down
Loading