This commit is contained in:
lyzhan7 2022-08-10 16:23:33 -07:00
Родитель 2190b3b978
Коммит 5f594b4c23
1 изменённых файлов: 15 добавлений и 0 удалений

Просмотреть файл

@ -716,6 +716,21 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : unused)
#endif // TODO(macOS GH#774)
#if TARGET_OS_OSX // [TODO(macOS GH#774)
- (NSShadow*)shadow {
CALayer *layer = self.layer;
// Workaround AppKit issue with directly manipulating the view layer's shadow.
if (layer.shadowColor != nil && layer.shadowOpacity > 0) {
NSShadow *shadow = [NSShadow new];
shadow.shadowColor = [NSColor colorWithCGColor:layer.shadowColor];
shadow.shadowOffset = layer.shadowOffset;
shadow.shadowBlurRadius = layer.shadowRadius;
return shadow;
}
return nil;
}
- (void)viewDidMoveToWindow
{
// Subscribe to view bounds changed notification so that the view can be notified when a