mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-01 14:25:08 +08:00
Make Spacing cloneable
Reviewed By: achen1 Differential Revision: D7626745 fbshipit-source-id: ca6070a99d561ee5d5dd27456116dd2de75d2bf3
This commit is contained in:
committed by
Facebook Github Bot
parent
49655c6eb3
commit
7e824867ca
@@ -106,7 +106,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
|
||||
private int mScreenY;
|
||||
private int mScreenWidth;
|
||||
private int mScreenHeight;
|
||||
private final Spacing mDefaultPadding = new Spacing(0);
|
||||
private final Spacing mDefaultPadding;
|
||||
private final float[] mPadding = new float[Spacing.ALL + 1];
|
||||
private final boolean[] mPaddingIsPercent = new boolean[Spacing.ALL + 1];
|
||||
private YogaNode mYogaNode;
|
||||
@@ -115,6 +115,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
|
||||
private @Nullable ReactStylesDiffMap mNewProps;
|
||||
|
||||
public ReactShadowNodeImpl() {
|
||||
mDefaultPadding = new Spacing(0);
|
||||
if (!isVirtual()) {
|
||||
YogaNode node = YogaNodePool.get().acquire();
|
||||
mYogaNode = node == null ? new YogaNode(sYogaConfig) : node;
|
||||
@@ -133,6 +134,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
|
||||
mShouldNotifyOnLayout = original.mShouldNotifyOnLayout;
|
||||
mIsLayoutOnly = original.mIsLayoutOnly;
|
||||
mNativeParent = original.mNativeParent;
|
||||
mDefaultPadding = new Spacing(original.mDefaultPadding);
|
||||
// Cloned nodes should be always updated.
|
||||
mNodeUpdated = true;
|
||||
// "cached" screen coordinates are not cloned because FabricJS not always clone the last
|
||||
|
||||
Reference in New Issue
Block a user