Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

fix(ios): Xcode12 build run on device crash #70

Merged
merged 1 commit into from
Nov 9, 2020
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
5 changes: 4 additions & 1 deletion ios/ARTNode.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#import "ARTNode.h"

#import "ARTContainer.h"
#import "RCTConvert+ART.h"

@implementation ARTNode

Expand Down Expand Up @@ -79,7 +80,9 @@ - (void)renderContentTo:(CGContextRef)context {
CGContextSaveGState(context);
CGContextConcatCTM(context, self.transform);
CGContextSetAlpha(context, self.opacity);
CGContextSetShadowWithColor(context, self.shadow.offset, self.shadow.blur, self.shadow.color.CGColor);
UIColor *color = [UIColor colorWithCGColor:[RCTConvert CGColor:@(self.shadow.color)]];
color = [color colorWithAlphaComponent:self.shadow.alpha];
CGContextSetShadowWithColor(context, self.shadow.offset, self.shadow.blur, color.CGColor);
}

- (void)renderLayerTo:(CGContextRef)context
Expand Down
3 changes: 2 additions & 1 deletion ios/ARTShadow.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
typedef struct {
CGSize offset;
CGFloat blur;
UIColor* color;
CGFloat alpha;
CGFloat color;
} ARTShadow;
7 changes: 2 additions & 5 deletions ios/RCTConvert+ART.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,9 @@ + (ARTBrush *)ARTBrush:(id)json
+ (ARTShadow)ARTShadow:(id)json
{
NSArray *arr = [self NSArray:json];

UIColor *color = [UIColor colorWithCGColor:[self CGColor:[arr objectAtIndex:0]]];
color = [color colorWithAlphaComponent:[[arr objectAtIndex:1] floatValue]];

return (ARTShadow){
.color = color,
.color = [[arr objectAtIndex:0] doubleValue],
.alpha = [[arr objectAtIndex:1] floatValue],
.blur = [[arr objectAtIndex:2] floatValue],
.offset = (CGSize){
.width = [[arr objectAtIndex:3] floatValue],
Expand Down