Skip to content

Commit b7ba225

Browse files
Timothy Kukulskigrabbou
authored andcommitted
allow zero offset when shadow radius is nonzero
Summary: update creation logic for text shadow: allow shadows with zero offset when the radius is nonzero (?should we also add a check to drop the node as a no-op when color.alpha == 0 ?) Reviewed By: yungsters Differential Revision: D10017778 fbshipit-source-id: 0168ac6db5ad22a5d7eb32dcd184aede361d6651
1 parent bc973d2 commit b7ba225

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77
package com.facebook.react.views.text;
88

9+
import android.graphics.Color;
910
import android.graphics.Typeface;
1011
import android.os.Build;
1112
import android.text.Layout;
@@ -148,7 +149,10 @@ private static void buildSpannedFromShadowNode(
148149
if (textShadowNode.mIsLineThroughTextDecorationSet) {
149150
ops.add(new SetSpanOperation(start, end, new StrikethroughSpan()));
150151
}
151-
if (textShadowNode.mTextShadowOffsetDx != 0 || textShadowNode.mTextShadowOffsetDy != 0) {
152+
if ((textShadowNode.mTextShadowOffsetDx != 0
153+
|| textShadowNode.mTextShadowOffsetDy != 0
154+
|| textShadowNode.mTextShadowRadius != 0)
155+
&& Color.alpha(textShadowNode.mTextShadowColor) != 0) {
152156
ops.add(
153157
new SetSpanOperation(
154158
start,

0 commit comments

Comments
 (0)