Skip to content

Commit

Permalink
[iOS] Fabric: Fixes TextInput crash when textShadowOffset is set and …
Browse files Browse the repository at this point in the history
…textShadowRadius is nan
  • Loading branch information
zhongwuzw committed Dec 17, 2024
1 parent 03a1246 commit 14334d1
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,12 @@ inline static CGFloat RCTEffectiveFontSizeMultiplierFromTextAttributes(const Tex
auto textShadowOffset = textAttributes.textShadowOffset.value();
NSShadow *shadow = [NSShadow new];
shadow.shadowOffset = CGSize{textShadowOffset.width, textShadowOffset.height};
shadow.shadowBlurRadius = textAttributes.textShadowRadius;
shadow.shadowColor = RCTUIColorFromSharedColor(textAttributes.textShadowColor);
if (!isnan(textAttributes.textShadowRadius)) {
shadow.shadowBlurRadius = textAttributes.textShadowRadius;
}
if (textAttributes.textShadowColor) {
shadow.shadowColor = RCTUIColorFromSharedColor(textAttributes.textShadowColor);
}
attributes[NSShadowAttributeName] = shadow;
}

Expand Down

0 comments on commit 14334d1

Please sign in to comment.