From 05fd10d12f1822d38ea6aafc3e0435d9640ca307 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Fri, 24 Mar 2023 04:31:06 -0700 Subject: [PATCH] Fix default shadow radius in TextAttributeProps (#36621) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/36621 After D44302691 enabled textShadow, there was a subtle 1px shadow on any new text which I did't spot, but screenshot tests did (after commit which is non-ideal, but there is more work to make these land blocking). This is because unlike `ReactBaseTextShadowNode` in paper which defaults to a radius of zero (no shadow), `TextAttributes` in Fabric defaults to a radius of 1px. Just previously never displayed. Without shadow: https://pxl.cl/2z2wX With shadow: https://pxl.cl/2z2x0 This changes the default to zero, which will cause us to skip adding the span, and matches previous behavior in Paper. I double-checked the other props are defaulted the same way between `BaseTextShadowNode` (Paper) and `TextAttributes` (Fabric). Changelog: [Android][Fixed] - Fix default shadow radius in TextAttributeProps Reviewed By: javache Differential Revision: D44364446 fbshipit-source-id: d207367608291048001403d292f881c0842113f9 --- .../java/com/facebook/react/views/text/TextAttributeProps.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java index 306cfee86ff..bc53523c815 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java @@ -96,7 +96,7 @@ public class TextAttributeProps { protected float mTextShadowOffsetDx = 0; protected float mTextShadowOffsetDy = 0; - protected float mTextShadowRadius = 1; + protected float mTextShadowRadius = 0; protected int mTextShadowColor = DEFAULT_TEXT_SHADOW_COLOR; protected boolean mIsUnderlineTextDecorationSet = false;