From 47266b9ae84ed5eed6fc6d25ba0d892ca18611d5 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Wed, 11 Jan 2017 03:58:03 -0800 Subject: [PATCH] Add percentage support to react native Summary: @public Adds support for percentage value in react native. syntax: property: 100 | property | '100%' supported properties: padding margin width height minWidth minHeight maxWidth maxHeight flexBasis ``` class Playground extends React.Component { render() { return ( If you want to quickly test out something, open the Playground.js file and start coding. ); } } ``` Reviewed By: astreet Differential Revision: D4376549 fbshipit-source-id: c41d68a7555396f95d063a7527ee081773ac56dc --- java/com/facebook/yoga/YogaValue.java | 2 +- yoga/Yoga.c | 2 -- yoga/Yoga.h | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/java/com/facebook/yoga/YogaValue.java b/java/com/facebook/yoga/YogaValue.java index c2d257fc..1110eded 100644 --- a/java/com/facebook/yoga/YogaValue.java +++ b/java/com/facebook/yoga/YogaValue.java @@ -19,7 +19,7 @@ public class YogaValue { public final float value; public final YogaUnit unit; - YogaValue(float value, YogaUnit unit) { + public YogaValue(float value, YogaUnit unit) { this.value = value; this.unit = unit; } diff --git a/yoga/Yoga.c b/yoga/Yoga.c index 0e7bec47..598f273c 100644 --- a/yoga/Yoga.c +++ b/yoga/Yoga.c @@ -181,8 +181,6 @@ YGCalloc gYGCalloc = &calloc; YGRealloc gYGRealloc = &realloc; YGFree gYGFree = &free; -static YGValue YGValueUndefined = YG_UNDEFINED_VALUES; - static YGValue YGValueZero = {.value = 0, .unit = YGUnitPixel}; #ifdef ANDROID diff --git a/yoga/Yoga.h b/yoga/Yoga.h index 34a90f57..cb21910d 100644 --- a/yoga/Yoga.h +++ b/yoga/Yoga.h @@ -43,6 +43,8 @@ typedef struct YGValue { YGUnit unit; } YGValue; +static const YGValue YGValueUndefined = { YGUndefined, YGUnitUndefined }; + typedef struct YGNode *YGNodeRef; typedef YGSize (*YGMeasureFunc)(YGNodeRef node, float width,