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
This commit is contained in:
Nicolas Gallagher 2018-11-26 17:22:22 -08:00 committed by Facebook Github Bot
parent 53da585832
commit fd78eee11b

View File

@ -151,10 +151,14 @@ public abstract class ReactBaseTextShadowNode extends LayoutShadowNode {
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 @@ public abstract class ReactBaseTextShadowNode extends LayoutShadowNode {
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;