From fd78eee11b71799aa7fa57bbd70d59c6c642c3b3 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Mon, 26 Nov 2018 17:22:22 -0800 Subject: [PATCH] Fix text alpha bug Summary: Set the default text radius to 0 so that text shadows aren't applied to every text node Reviewed By: mdvacca Differential Revision: D13027589 fbshipit-source-id: 4f7386059ac1654b8f77dddf9eb1b772f6049e23 --- .../react/views/text/ReactBaseTextShadowNode.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java index b1c68b987e9cdb..05091cc328954f 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java @@ -151,10 +151,14 @@ private static void buildSpannedFromShadowNode( if (textShadowNode.mIsLineThroughTextDecorationSet) { ops.add(new SetSpanOperation(start, end, new StrikethroughSpan())); } - if ((textShadowNode.mTextShadowOffsetDx != 0 - || textShadowNode.mTextShadowOffsetDy != 0 - || textShadowNode.mTextShadowRadius != 0) - && Color.alpha(textShadowNode.mTextShadowColor) != 0) { + if ( + ( + textShadowNode.mTextShadowOffsetDx != 0 || + textShadowNode.mTextShadowOffsetDy != 0 || + textShadowNode.mTextShadowRadius != 0 + ) && + Color.alpha(textShadowNode.mTextShadowColor) != 0 + ) { ops.add( new SetSpanOperation( start, @@ -270,7 +274,7 @@ private static int parseNumericFontWeight(String fontWeightString) { 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;