Skip to content
Draft
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
14 changes: 4 additions & 10 deletions packages/react-native/React/Views/RCTView.m
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ @implementation RCTView {
NSTrackingArea *_trackingArea;
BOOL _hasMouseOver;
BOOL _mouseDownCanMoveWindow;
NSColor *_innerShadowColor;
#endif // macOS]
NSMutableDictionary<NSString *, NSDictionary *> *accessibilityActionsNameMap;
NSMutableDictionary<NSString *, NSDictionary *> *accessibilityActionsLabelMap;
Expand Down Expand Up @@ -731,11 +732,8 @@ - (NSString *)description
#if TARGET_OS_OSX // [macOS
- (void)setShadowColor:(CGColorRef)shadowColor
{
if (_shadowColor != shadowColor)
{
_shadowColor = shadowColor;
[self didUpdateShadow];
}
_innerShadowColor = shadowColor != NULL ? [NSColor colorWithCGColor:shadowColor] : nil;
[self didUpdateShadow];
}

- (void)setShadowOffset:(CGSize)shadowOffset
Expand Down Expand Up @@ -768,11 +766,7 @@ - (void)setShadowRadius:(CGFloat)shadowRadius
-(void)didUpdateShadow
{
NSShadow *shadow = [NSShadow new];
NSColor *baseShadowColor = nil;
if (_shadowColor != NULL) {
baseShadowColor = [NSColor colorWithCGColor:_shadowColor];
}
shadow.shadowColor = [baseShadowColor colorWithAlphaComponent:[self shadowOpacity]];
shadow.shadowColor = [_innerShadowColor colorWithAlphaComponent:[self shadowOpacity]];
shadow.shadowOffset = [self shadowOffset];
shadow.shadowBlurRadius = [self shadowRadius];
[self setShadow:shadow];
Expand Down
Loading