Skip to content

Commit

Permalink
Fix text alpha bug
Browse files Browse the repository at this point in the history
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
  • Loading branch information
necolas authored and facebook-github-bot committed Nov 27, 2018
1 parent 53da585 commit fd78eee
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit fd78eee

Please sign in to comment.