mirror of
https://github.com/status-im/react-native.git
synced 2025-02-21 21:58:18 +00:00
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
This commit is contained in:
parent
6715268794
commit
97f0e43710
@ -6,6 +6,7 @@
|
||||
*/
|
||||
package com.facebook.react.views.text;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Build;
|
||||
import android.text.Layout;
|
||||
@ -150,7 +151,10 @@ public abstract class ReactBaseTextShadowNode extends LayoutShadowNode {
|
||||
if (textShadowNode.mIsLineThroughTextDecorationSet) {
|
||||
ops.add(new SetSpanOperation(start, end, new StrikethroughSpan()));
|
||||
}
|
||||
if (textShadowNode.mTextShadowOffsetDx != 0 || textShadowNode.mTextShadowOffsetDy != 0) {
|
||||
if ((textShadowNode.mTextShadowOffsetDx != 0
|
||||
|| textShadowNode.mTextShadowOffsetDy != 0
|
||||
|| textShadowNode.mTextShadowRadius != 0)
|
||||
&& Color.alpha(textShadowNode.mTextShadowColor) != 0) {
|
||||
ops.add(
|
||||
new SetSpanOperation(
|
||||
start,
|
||||
|
Loading…
x
Reference in New Issue
Block a user