mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-08 22:42:05 +08:00
Disable yoga rounding for RN
Reviewed By: shergin Differential Revision: D4964205 fbshipit-source-id: d3f709713d61f663245fd2208057dbc75aece049
This commit is contained in:
committed by
Facebook Github Bot
parent
ca07a5fd5f
commit
39f9e7a6b1
@@ -15,6 +15,7 @@ import java.util.Arrays;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.facebook.yoga.YogaAlign;
|
||||
import com.facebook.yoga.YogaConfig;
|
||||
import com.facebook.yoga.YogaDisplay;
|
||||
import com.facebook.yoga.YogaEdge;
|
||||
import com.facebook.yoga.YogaConstants;
|
||||
@@ -78,12 +79,17 @@ public class ReactShadowNode {
|
||||
private final float[] mPadding = new float[Spacing.ALL + 1];
|
||||
private final boolean[] mPaddingIsPercent = new boolean[Spacing.ALL + 1];
|
||||
private final YogaNode mYogaNode;
|
||||
private static YogaConfig sYogaConfig;
|
||||
|
||||
public ReactShadowNode() {
|
||||
if (!isVirtual()) {
|
||||
YogaNode node = YogaNodePool.get().acquire();
|
||||
if (sYogaConfig == null) {
|
||||
sYogaConfig = new YogaConfig();
|
||||
sYogaConfig.setPointScaleFactor(0f);
|
||||
}
|
||||
if (node == null) {
|
||||
node = new YogaNode();
|
||||
node = new YogaNode(sYogaConfig);
|
||||
}
|
||||
mYogaNode = node;
|
||||
Arrays.fill(mPadding, YogaConstants.UNDEFINED);
|
||||
|
||||
Reference in New Issue
Block a user