Skip to content

Commit fd78eee

Browse files
necolasfacebook-github-bot
authored andcommitted
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
1 parent 53da585 commit fd78eee

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java

+9-5
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,14 @@ private static void buildSpannedFromShadowNode(
151151
if (textShadowNode.mIsLineThroughTextDecorationSet) {
152152
ops.add(new SetSpanOperation(start, end, new StrikethroughSpan()));
153153
}
154-
if ((textShadowNode.mTextShadowOffsetDx != 0
155-
|| textShadowNode.mTextShadowOffsetDy != 0
156-
|| textShadowNode.mTextShadowRadius != 0)
157-
&& Color.alpha(textShadowNode.mTextShadowColor) != 0) {
154+
if (
155+
(
156+
textShadowNode.mTextShadowOffsetDx != 0 ||
157+
textShadowNode.mTextShadowOffsetDy != 0 ||
158+
textShadowNode.mTextShadowRadius != 0
159+
) &&
160+
Color.alpha(textShadowNode.mTextShadowColor) != 0
161+
) {
158162
ops.add(
159163
new SetSpanOperation(
160164
start,
@@ -270,7 +274,7 @@ private static int parseNumericFontWeight(String fontWeightString) {
270274

271275
protected float mTextShadowOffsetDx = 0;
272276
protected float mTextShadowOffsetDy = 0;
273-
protected float mTextShadowRadius = 1;
277+
protected float mTextShadowRadius = 0;
274278
protected int mTextShadowColor = DEFAULT_TEXT_SHADOW_COLOR;
275279

276280
protected boolean mIsUnderlineTextDecorationSet = false;

0 commit comments

Comments
 (0)