Permalink
Browse files

Disable yoga rounding for RN

Reviewed By: shergin

Differential Revision: D4964205

fbshipit-source-id: d3f709713d61f663245fd2208057dbc75aece049
  • Loading branch information...
emilsjolander authored and facebook-github-bot committed Apr 27, 2017
1 parent ca07a5f commit 39f9e7a6b1c8c3491efec41777e16957fdbd9c81
Showing with 7 additions and 1 deletion.
  1. +7 −1 ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNode.java
@@ -15,6 +15,7 @@
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 @@
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);

0 comments on commit 39f9e7a

Please sign in to comment.