Don't set self.opaque = false on macOS (#2008)

Don't set `self.opaque = false` on macOS
This commit is contained in:
Hampus Sjöberg
2023-03-23 17:18:55 +01:00
committed by GitHub
parent 5b6b555fa2
commit 5cfa4dfc6a
2 changed files with 6 additions and 0 deletions

View File

@@ -45,8 +45,10 @@ using namespace facebook::react;
#ifdef RCT_NEW_ARCH_ENABLED
static const auto defaultProps = std::make_shared<const RNSVGSvgViewProps>();
_props = defaultProps;
#if !TARGET_OS_OSX // On macOS, views are transparent by default
// TODO: think if we can do it better
self.opaque = NO;
#endif // TARGET_OS_OSX
#endif // RCT_NEW_ARCH_ENABLED
}
return self;

View File

@@ -34,7 +34,9 @@ CGFloat const RNSVG_DEFAULT_FONT_SIZE = 12;
{
if (self = [super init]) {
self.opacity = 1;
#if !TARGET_OS_OSX // On macOS, views are transparent by default
self.opaque = false;
#endif
self.matrix = CGAffineTransformIdentity;
self.transforms = CGAffineTransformIdentity;
self.invTransform = CGAffineTransformIdentity;
@@ -619,7 +621,9 @@ CGFloat const RNSVG_DEFAULT_FONT_SIZE = 12;
[super prepareForRecycle];
self.opacity = 1;
#if !TARGET_OS_OSX // On macOS, views are transparent by default
self.opaque = false;
#endif
self.matrix = CGAffineTransformIdentity;
self.transforms = CGAffineTransformIdentity;
self.invTransform = CGAffineTransformIdentity;