added initial margin auto support

use leading and trailing instead of hardcoded ygedge

correctly apply margin auto on crossAxis

enum.py and reformat

reformat

delete formating file

revert unrelated changes

add spaces

apply justifycontent only if there aren't any auto margins

fix enum definition

rerun format

apply auto as default values to width, height and flexBasis to conform with spec

code review and additional tests

added missing language bindings for c# and java

regen tests

added initial margin auto support

use leading and trailing instead of hardcoded ygedge

correctly apply margin auto on crossAxis

enum.py and reformat

delete formating file

revert unrelated changes

add spaces

apply justifycontent only if there aren't any auto margins

fix enum definition

rerun format

apply auto as default values to width, height and flexBasis to conform with spec

code review and additional tests

added missing language bindings for c# and java

fix up rebase

add javascript test

another fix up
This commit is contained in:
Lukas Wöhrl
2017-01-27 00:02:28 +01:00
parent 76fbd628e1
commit 31e25f652a
28 changed files with 3342 additions and 51 deletions

View File

@@ -196,6 +196,9 @@ namespace Facebook.Yoga
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetFlexBasisPercent(YGNodeHandle node, float flexBasis);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetFlexBasisAuto(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetFlexBasis(YGNodeHandle node);
@@ -205,6 +208,9 @@ namespace Facebook.Yoga
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetWidthPercent(YGNodeHandle node, float width);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetWidthAuto(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetWidth(YGNodeHandle node);
@@ -213,6 +219,9 @@ namespace Facebook.Yoga
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetHeightPercent(YGNodeHandle node, float height);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetHeightAuto(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetHeight(YGNodeHandle node);
@@ -278,6 +287,9 @@ namespace Facebook.Yoga
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetMarginPercent(YGNodeHandle node, YogaEdge edge, float margin);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetMarginAuto(YGNodeHandle node, YogaEdge edge);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetMargin(YGNodeHandle node, YogaEdge edge);

View File

@@ -226,6 +226,10 @@ namespace Facebook.Yoga
{
Native.YGNodeStyleSetMarginPercent(_ygNode, edge, value.Value);
}
else if (value.Unit == YogaUnit.Auto)
{
Native.YGNodeStyleSetMarginAuto(_ygNode, edge);
}
else
{
Native.YGNodeStyleSetMargin(_ygNode, edge, value.Value);

View File

@@ -270,6 +270,10 @@ namespace Facebook.Yoga
{
Native.YGNodeStyleSetFlexBasisPercent(_ygNode, value.Value);
}
else if (value.Unit == YogaUnit.Auto)
{
Native.YGNodeStyleSetFlexBasisAuto(_ygNode);
}
else
{
Native.YGNodeStyleSetFlexBasis(_ygNode, value.Value);
@@ -290,6 +294,10 @@ namespace Facebook.Yoga
{
Native.YGNodeStyleSetWidthPercent(_ygNode, value.Value);
}
else if (value.Unit == YogaUnit.Auto)
{
Native.YGNodeStyleSetWidthAuto(_ygNode);
}
else
{
Native.YGNodeStyleSetWidth(_ygNode, value.Value);
@@ -310,6 +318,10 @@ namespace Facebook.Yoga
{
Native.YGNodeStyleSetHeightPercent(_ygNode, value.Value);
}
else if (value.Unit == YogaUnit.Auto)
{
Native.YGNodeStyleSetHeightAuto(_ygNode);
}
else
{
Native.YGNodeStyleSetHeight(_ygNode, value.Value);

View File

@@ -14,5 +14,6 @@ namespace Facebook.Yoga
Undefined,
Pixel,
Percent,
Auto,
}
}

View File

@@ -70,6 +70,15 @@ namespace Facebook.Yoga
};
}
public static YogaValue Auto()
{
return new YogaValue
{
value = 0f,
unit = YogaUnit.Auto
};
}
public static YogaValue Percent(float value)
{
return new YogaValue