Rename enums

Summary: new name, start by renaming enums

Differential Revision: D4244360

fbshipit-source-id: c9fcbdd231098c9ff230a6055676bbc7cbd11001
This commit is contained in:
Emil Sjolander
2016-12-02 05:47:43 -08:00
committed by Facebook Github Bot
parent 07cf47baad
commit 42b6f6b6e5
107 changed files with 2546 additions and 2562 deletions

View File

@@ -11,7 +11,7 @@
static CSSInteropLoggerFunc gManagedFunc;
static int unmanagedLogger(CSSLogLevel level, const char *format, va_list args) {
static int unmanagedLogger(YGLogLevel level, const char *format, va_list args) {
int result = 0;
if (gManagedFunc) {
char buffer[256];

View File

@@ -13,7 +13,7 @@
CSS_EXTERN_C_BEGIN
typedef void (*CSSInteropLoggerFunc)(CSSLogLevel level, const char *message);
typedef void (*CSSInteropLoggerFunc)(YGLogLevel level, const char *message);
WIN_EXPORT void CSSInteropSetLogger(CSSInteropLoggerFunc managedFunc);

View File

@@ -1,22 +0,0 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
namespace Facebook.CSSLayout
{
public enum CSSDirection
{
Inherit,
LTR,
RTL,
[System.Obsolete("Use LTR instead")]
LeftToRight = LTR,
[System.Obsolete("Use RTL instead")]
RightToLeft = RTL,
}
}

View File

@@ -15,7 +15,7 @@ namespace Facebook.CSSLayout
internal static class CSSLogger
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void Func(CSSLogLevel level, string message);
public delegate void Func(YogaLogLevel level, string message);
private static bool _initialized;
private static Func _managedLogger = null;
@@ -32,7 +32,7 @@ namespace Facebook.CSSLayout
Logger(level, message);
}
if (level == CSSLogLevel.Error)
if (level == YogaLogLevel.Error)
{
throw new InvalidOperationException(message);
}

View File

@@ -14,9 +14,9 @@ namespace Facebook.CSSLayout
{
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate CSSSize CSSMeasureFunc(
IntPtr node,
IntPtr node,
float width,
CSSMeasureMode widthMode,
YogaMeasureMode widthMode,
float height,
CSSMeasureMode heightMode);
YogaMeasureMode heightMode);
}

View File

@@ -14,15 +14,15 @@ namespace Facebook.CSSLayout
public partial class CSSNode
{
public static CSSNode Create(
CSSDirection? styleDirection = null,
CSSFlexDirection? flexDirection = null,
CSSJustify? justifyContent = null,
CSSAlign? alignContent = null,
CSSAlign? alignItems = null,
CSSAlign? alignSelf = null,
CSSPositionType? positionType = null,
CSSWrap? wrap = null,
CSSOverflow? overflow = null,
YogaDirection? styleDirection = null,
YogaFlexDirection? flexDirection = null,
YogaJustify? justifyContent = null,
YogaAlign? alignContent = null,
YogaAlign? alignItems = null,
YogaAlign? alignSelf = null,
YogaPositionType? positionType = null,
YogaWrap? wrap = null,
YogaOverflow? overflow = null,
float? flex = null,
float? flexGrow = null,
float? flexShrink = null,
@@ -110,22 +110,22 @@ namespace Facebook.CSSLayout
{
if (position.Top.HasValue)
{
node.SetPosition(CSSEdge.Top, position.Top.Value);
node.SetPosition(YogaEdge.Top, position.Top.Value);
}
if (position.Bottom.HasValue)
{
node.SetPosition(CSSEdge.Bottom, position.Bottom.Value);
node.SetPosition(YogaEdge.Bottom, position.Bottom.Value);
}
if (position.Left.HasValue)
{
node.SetPosition(CSSEdge.Left, position.Left.Value);
node.SetPosition(YogaEdge.Left, position.Left.Value);
}
if (position.Right.HasValue)
{
node.SetPosition(CSSEdge.Right, position.Right.Value);
node.SetPosition(YogaEdge.Right, position.Right.Value);
}
}
@@ -133,22 +133,22 @@ namespace Facebook.CSSLayout
{
if (margin.Top.HasValue)
{
node.SetMargin(CSSEdge.Top, margin.Top.Value);
node.SetMargin(YogaEdge.Top, margin.Top.Value);
}
if (margin.Bottom.HasValue)
{
node.SetMargin(CSSEdge.Bottom, margin.Bottom.Value);
node.SetMargin(YogaEdge.Bottom, margin.Bottom.Value);
}
if (margin.Left.HasValue)
{
node.SetMargin(CSSEdge.Left, margin.Left.Value);
node.SetMargin(YogaEdge.Left, margin.Left.Value);
}
if (margin.Right.HasValue)
{
node.SetMargin(CSSEdge.Right, margin.Right.Value);
node.SetMargin(YogaEdge.Right, margin.Right.Value);
}
}
@@ -156,22 +156,22 @@ namespace Facebook.CSSLayout
{
if (padding.Top.HasValue)
{
node.SetPadding(CSSEdge.Top, padding.Top.Value);
node.SetPadding(YogaEdge.Top, padding.Top.Value);
}
if (padding.Bottom.HasValue)
{
node.SetPadding(CSSEdge.Bottom, padding.Bottom.Value);
node.SetPadding(YogaEdge.Bottom, padding.Bottom.Value);
}
if (padding.Left.HasValue)
{
node.SetPadding(CSSEdge.Left, padding.Left.Value);
node.SetPadding(YogaEdge.Left, padding.Left.Value);
}
if (padding.Right.HasValue)
{
node.SetPadding(CSSEdge.Right, padding.Right.Value);
node.SetPadding(YogaEdge.Right, padding.Right.Value);
}
}
@@ -179,22 +179,22 @@ namespace Facebook.CSSLayout
{
if (border.Top.HasValue)
{
node.SetBorder(CSSEdge.Top, border.Top.Value);
node.SetBorder(YogaEdge.Top, border.Top.Value);
}
if (border.Bottom.HasValue)
{
node.SetBorder(CSSEdge.Bottom, border.Bottom.Value);
node.SetBorder(YogaEdge.Bottom, border.Bottom.Value);
}
if (border.Left.HasValue)
{
node.SetBorder(CSSEdge.Left, border.Left.Value);
node.SetBorder(YogaEdge.Left, border.Left.Value);
}
if (border.Right.HasValue)
{
node.SetBorder(CSSEdge.Right, border.Right.Value);
node.SetBorder(YogaEdge.Right, border.Right.Value);
}
}

View File

@@ -95,7 +95,7 @@ namespace Facebook.CSSLayout
Native.CSSNodeCopyStyle(_cssNode, srcNode._cssNode);
}
public CSSDirection StyleDirection
public YogaDirection StyleDirection
{
get
{
@@ -108,7 +108,7 @@ namespace Facebook.CSSLayout
}
}
public CSSFlexDirection FlexDirection
public YogaFlexDirection FlexDirection
{
get
{
@@ -121,7 +121,7 @@ namespace Facebook.CSSLayout
}
}
public CSSJustify JustifyContent
public YogaJustify JustifyContent
{
get
{
@@ -134,7 +134,7 @@ namespace Facebook.CSSLayout
}
}
public CSSAlign AlignItems
public YogaAlign AlignItems
{
get
{
@@ -147,7 +147,7 @@ namespace Facebook.CSSLayout
}
}
public CSSAlign AlignSelf
public YogaAlign AlignSelf
{
get
{
@@ -160,7 +160,7 @@ namespace Facebook.CSSLayout
}
}
public CSSAlign AlignContent
public YogaAlign AlignContent
{
get
{
@@ -173,7 +173,7 @@ namespace Facebook.CSSLayout
}
}
public CSSPositionType PositionType
public YogaPositionType PositionType
{
get
{
@@ -186,7 +186,7 @@ namespace Facebook.CSSLayout
}
}
public CSSWrap Wrap
public YogaWrap Wrap
{
get
{
@@ -246,42 +246,42 @@ namespace Facebook.CSSLayout
}
}
public float GetMargin(CSSEdge edge)
public float GetMargin(YogaEdge edge)
{
return Native.CSSNodeStyleGetMargin(_cssNode, edge);
}
public void SetMargin(CSSEdge edge, float value)
public void SetMargin(YogaEdge edge, float value)
{
Native.CSSNodeStyleSetMargin(_cssNode, edge, value);
}
public float GetPadding(CSSEdge edge)
public float GetPadding(YogaEdge edge)
{
return Native.CSSNodeStyleGetPadding(_cssNode, edge);
}
public void SetPadding(CSSEdge edge, float padding)
public void SetPadding(YogaEdge edge, float padding)
{
Native.CSSNodeStyleSetPadding(_cssNode, edge, padding);
}
public float GetBorder(CSSEdge edge)
public float GetBorder(YogaEdge edge)
{
return Native.CSSNodeStyleGetBorder(_cssNode, edge);
}
public void SetBorder(CSSEdge edge, float border)
public void SetBorder(YogaEdge edge, float border)
{
Native.CSSNodeStyleSetBorder(_cssNode, edge, border);
}
public float GetPosition(CSSEdge edge)
public float GetPosition(YogaEdge edge)
{
return Native.CSSNodeStyleGetPosition(_cssNode, edge);
}
public void SetPosition(CSSEdge edge, float position)
public void SetPosition(YogaEdge edge, float position)
{
Native.CSSNodeStyleSetPosition(_cssNode, edge, position);
}
@@ -409,7 +409,7 @@ namespace Facebook.CSSLayout
}
}
public CSSDirection LayoutDirection
public YogaDirection LayoutDirection
{
get
{
@@ -417,7 +417,7 @@ namespace Facebook.CSSLayout
}
}
public CSSOverflow Overflow
public YogaOverflow Overflow
{
get
{
@@ -520,17 +520,17 @@ namespace Facebook.CSSLayout
{
Native.CSSNodeCalculateLayout(
_cssNode,
CSSConstants.Undefined,
CSSConstants.Undefined,
YogaConstants.Undefined,
YogaConstants.Undefined,
Native.CSSNodeStyleGetDirection(_cssNode));
}
private CSSSize MeasureInternal(
IntPtr node,
float width,
CSSMeasureMode widthMode,
YogaMeasureMode widthMode,
float height,
CSSMeasureMode heightMode)
YogaMeasureMode heightMode)
{
if (_measureFunction == null)
{
@@ -541,8 +541,8 @@ namespace Facebook.CSSLayout
return new CSSSize { width = MeasureOutput.GetWidth(output), height = MeasureOutput.GetHeight(output) };
}
public string Print(CSSPrintOptions options =
CSSPrintOptions.Layout|CSSPrintOptions.Style|CSSPrintOptions.Children)
public string Print(YogaPrintOptions options =
YogaPrintOptions.Layout|YogaPrintOptions.Style|YogaPrintOptions.Children)
{
StringBuilder sb = new StringBuilder();
CSSLogger.Func orig = CSSLogger.Logger;
@@ -570,13 +570,13 @@ namespace Facebook.CSSLayout
}
public static void SetExperimentalFeatureEnabled(
CSSExperimentalFeature feature,
YogaExperimentalFeature feature,
bool enabled)
{
Native.CSSLayoutSetExperimentalFeatureEnabled(feature, enabled);
}
public static bool IsExperimentalFeatureEnabled(CSSExperimentalFeature feature)
public static bool IsExperimentalFeatureEnabled(YogaExperimentalFeature feature)
{
return Native.CSSLayoutIsExperimentalFeatureEnabled(feature);
}

View File

@@ -12,7 +12,7 @@ namespace Facebook.CSSLayout
public delegate long MeasureFunction(
CSSNode node,
float width,
CSSMeasureMode widthMode,
YogaMeasureMode widthMode,
float height,
CSSMeasureMode heightMode);
YogaMeasureMode heightMode);
}

View File

@@ -41,12 +41,12 @@ namespace Facebook.CSSLayout
[DllImport(DllName)]
public static extern void CSSLayoutSetExperimentalFeatureEnabled(
CSSExperimentalFeature feature,
YogaExperimentalFeature feature,
bool enabled);
[DllImport(DllName)]
public static extern bool CSSLayoutIsExperimentalFeatureEnabled(
CSSExperimentalFeature feature);
YogaExperimentalFeature feature);
[DllImport(DllName)]
public static extern void CSSNodeInsertChild(IntPtr node, IntPtr child, uint index);
@@ -64,7 +64,7 @@ namespace Facebook.CSSLayout
public static extern void CSSNodeCalculateLayout(IntPtr node,
float availableWidth,
float availableHeight,
CSSDirection parentDirection);
YogaDirection parentDirection);
[DllImport(DllName)]
public static extern void CSSNodeMarkDirty(IntPtr node);
@@ -74,7 +74,7 @@ namespace Facebook.CSSLayout
public static extern bool CSSNodeIsDirty(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodePrint(IntPtr node, CSSPrintOptions options);
public static extern void CSSNodePrint(IntPtr node, YogaPrintOptions options);
[DllImport(DllName)]
[return: MarshalAs(UnmanagedType.I1)]
@@ -112,58 +112,58 @@ namespace Facebook.CSSLayout
#region CSS_NODE_STYLE_PROPERTY
[DllImport(DllName)]
public static extern void CSSNodeStyleSetDirection(IntPtr node, CSSDirection direction);
public static extern void CSSNodeStyleSetDirection(IntPtr node, YogaDirection direction);
[DllImport(DllName)]
public static extern CSSDirection CSSNodeStyleGetDirection(IntPtr node);
public static extern YogaDirection CSSNodeStyleGetDirection(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetFlexDirection(IntPtr node, CSSFlexDirection flexDirection);
public static extern void CSSNodeStyleSetFlexDirection(IntPtr node, YogaFlexDirection flexDirection);
[DllImport(DllName)]
public static extern CSSFlexDirection CSSNodeStyleGetFlexDirection(IntPtr node);
public static extern YogaFlexDirection CSSNodeStyleGetFlexDirection(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetJustifyContent(IntPtr node, CSSJustify justifyContent);
public static extern void CSSNodeStyleSetJustifyContent(IntPtr node, YogaJustify justifyContent);
[DllImport(DllName)]
public static extern CSSJustify CSSNodeStyleGetJustifyContent(IntPtr node);
public static extern YogaJustify CSSNodeStyleGetJustifyContent(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetAlignContent(IntPtr node, CSSAlign alignContent);
public static extern void CSSNodeStyleSetAlignContent(IntPtr node, YogaAlign alignContent);
[DllImport(DllName)]
public static extern CSSAlign CSSNodeStyleGetAlignContent(IntPtr node);
public static extern YogaAlign CSSNodeStyleGetAlignContent(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetAlignItems(IntPtr node, CSSAlign alignItems);
public static extern void CSSNodeStyleSetAlignItems(IntPtr node, YogaAlign alignItems);
[DllImport(DllName)]
public static extern CSSAlign CSSNodeStyleGetAlignItems(IntPtr node);
public static extern YogaAlign CSSNodeStyleGetAlignItems(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetAlignSelf(IntPtr node, CSSAlign alignSelf);
public static extern void CSSNodeStyleSetAlignSelf(IntPtr node, YogaAlign alignSelf);
[DllImport(DllName)]
public static extern CSSAlign CSSNodeStyleGetAlignSelf(IntPtr node);
public static extern YogaAlign CSSNodeStyleGetAlignSelf(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetPositionType(IntPtr node, CSSPositionType positionType);
public static extern void CSSNodeStyleSetPositionType(IntPtr node, YogaPositionType positionType);
[DllImport(DllName)]
public static extern CSSPositionType CSSNodeStyleGetPositionType(IntPtr node);
public static extern YogaPositionType CSSNodeStyleGetPositionType(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetFlexWrap(IntPtr node, CSSWrap flexWrap);
public static extern void CSSNodeStyleSetFlexWrap(IntPtr node, YogaWrap flexWrap);
[DllImport(DllName)]
public static extern CSSWrap CSSNodeStyleGetFlexWrap(IntPtr node);
public static extern YogaWrap CSSNodeStyleGetFlexWrap(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetOverflow(IntPtr node, CSSOverflow flexWrap);
public static extern void CSSNodeStyleSetOverflow(IntPtr node, YogaOverflow flexWrap);
[DllImport(DllName)]
public static extern CSSOverflow CSSNodeStyleGetOverflow(IntPtr node);
public static extern YogaOverflow CSSNodeStyleGetOverflow(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetFlex(IntPtr node, float flex);
@@ -233,28 +233,28 @@ namespace Facebook.CSSLayout
#region CSS_NODE_STYLE_EDGE_PROPERTY
[DllImport(DllName)]
public static extern void CSSNodeStyleSetPosition(IntPtr node, CSSEdge edge, float position);
public static extern void CSSNodeStyleSetPosition(IntPtr node, YogaEdge edge, float position);
[DllImport(DllName)]
public static extern float CSSNodeStyleGetPosition(IntPtr node, CSSEdge edge);
public static extern float CSSNodeStyleGetPosition(IntPtr node, YogaEdge edge);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetMargin(IntPtr node, CSSEdge edge, float margin);
public static extern void CSSNodeStyleSetMargin(IntPtr node, YogaEdge edge, float margin);
[DllImport(DllName)]
public static extern float CSSNodeStyleGetMargin(IntPtr node, CSSEdge edge);
public static extern float CSSNodeStyleGetMargin(IntPtr node, YogaEdge edge);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetPadding(IntPtr node, CSSEdge edge, float padding);
public static extern void CSSNodeStyleSetPadding(IntPtr node, YogaEdge edge, float padding);
[DllImport(DllName)]
public static extern float CSSNodeStyleGetPadding(IntPtr node, CSSEdge edge);
public static extern float CSSNodeStyleGetPadding(IntPtr node, YogaEdge edge);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetBorder(IntPtr node, CSSEdge edge, float border);
public static extern void CSSNodeStyleSetBorder(IntPtr node, YogaEdge edge, float border);
[DllImport(DllName)]
public static extern float CSSNodeStyleGetBorder(IntPtr node, CSSEdge edge);
public static extern float CSSNodeStyleGetBorder(IntPtr node, YogaEdge edge);
#endregion
@@ -279,7 +279,7 @@ namespace Facebook.CSSLayout
public static extern float CSSNodeLayoutGetHeight(IntPtr node);
[DllImport(DllName)]
public static extern CSSDirection CSSNodeLayoutGetDirection(IntPtr node);
public static extern YogaDirection CSSNodeLayoutGetDirection(IntPtr node);
#endregion
}

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSAlign
public enum YogaAlign
{
Auto,
FlexStart,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public static class CSSConstants
public static class YogaConstants
{
public const float Undefined = float.NaN;

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSDimension
public enum YogaDimension
{
Width,
Height,

View File

@@ -0,0 +1,18 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
namespace Facebook.CSSLayout
{
public enum YogaDirection
{
Inherit,
LTR,
RTL,
}
}

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSEdge
public enum YogaEdge
{
Left,
Top,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSExperimentalFeature
public enum YogaExperimentalFeature
{
Rounding,
WebFlexBasis,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSFlexDirection
public enum YogaFlexDirection
{
Column,
ColumnReverse,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSJustify
public enum YogaJustify
{
FlexStart,
Center,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSLogLevel
public enum YogaLogLevel
{
Error,
Warn,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSMeasureMode
public enum YogaMeasureMode
{
Undefined,
Exactly,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSOverflow
public enum YogaOverflow
{
Visible,
Hidden,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSPositionType
public enum YogaPositionType
{
Relative,
Absolute,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSPrintOptions
public enum YogaPrintOptions
{
Layout = 1,
Style = 2,

View File

@@ -9,7 +9,7 @@
namespace Facebook.CSSLayout
{
public enum CSSWrap
public enum YogaWrap
{
NoWrap,
Wrap,

View File

@@ -25,13 +25,13 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.PositionType = CSSPositionType.Absolute;
root_child0.SetPosition(CSSEdge.Start, 10f);
root_child0.SetPosition(CSSEdge.Top, 10f);
root_child0.PositionType = YogaPositionType.Absolute;
root_child0.SetPosition(YogaEdge.Start, 10f);
root_child0.SetPosition(YogaEdge.Top, 10f);
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -44,7 +44,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -66,13 +66,13 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.PositionType = CSSPositionType.Absolute;
root_child0.SetPosition(CSSEdge.End, 10f);
root_child0.SetPosition(CSSEdge.Bottom, 10f);
root_child0.PositionType = YogaPositionType.Absolute;
root_child0.SetPosition(YogaEdge.End, 10f);
root_child0.SetPosition(YogaEdge.Bottom, 10f);
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -85,7 +85,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -107,13 +107,13 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.PositionType = CSSPositionType.Absolute;
root_child0.SetPosition(CSSEdge.Start, 10f);
root_child0.SetPosition(CSSEdge.Top, 10f);
root_child0.SetPosition(CSSEdge.End, 10f);
root_child0.SetPosition(CSSEdge.Bottom, 10f);
root_child0.PositionType = YogaPositionType.Absolute;
root_child0.SetPosition(YogaEdge.Start, 10f);
root_child0.SetPosition(YogaEdge.Top, 10f);
root_child0.SetPosition(YogaEdge.End, 10f);
root_child0.SetPosition(YogaEdge.Bottom, 10f);
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -126,7 +126,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(80f, root_child0.LayoutWidth);
Assert.AreEqual(80f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -148,15 +148,15 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.PositionType = CSSPositionType.Absolute;
root_child0.SetPosition(CSSEdge.Start, 10f);
root_child0.SetPosition(CSSEdge.Top, 10f);
root_child0.SetPosition(CSSEdge.End, 10f);
root_child0.SetPosition(CSSEdge.Bottom, 10f);
root_child0.PositionType = YogaPositionType.Absolute;
root_child0.SetPosition(YogaEdge.Start, 10f);
root_child0.SetPosition(YogaEdge.Top, 10f);
root_child0.SetPosition(YogaEdge.End, 10f);
root_child0.SetPosition(YogaEdge.Bottom, 10f);
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -169,7 +169,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -187,22 +187,22 @@ namespace Facebook.CSSLayout
public void Test_do_not_clamp_height_of_absolute_node_to_height_of_its_overflow_hidden_parent()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.Overflow = CSSOverflow.Hidden;
root.FlexDirection = YogaFlexDirection.Row;
root.Overflow = YogaOverflow.Hidden;
root.Width = 50f;
root.Height = 50f;
CSSNode root_child0 = new CSSNode();
root_child0.PositionType = CSSPositionType.Absolute;
root_child0.SetPosition(CSSEdge.Start, 0f);
root_child0.SetPosition(CSSEdge.Top, 0f);
root_child0.PositionType = YogaPositionType.Absolute;
root_child0.SetPosition(YogaEdge.Start, 0f);
root_child0.SetPosition(YogaEdge.Top, 0f);
root.Insert(0, root_child0);
CSSNode root_child0_child0 = new CSSNode();
root_child0_child0.Width = 100f;
root_child0_child0.Height = 100f;
root_child0.Insert(0, root_child0_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -220,7 +220,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0_child0.LayoutWidth);
Assert.AreEqual(100f, root_child0_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -243,37 +243,37 @@ namespace Facebook.CSSLayout
public void Test_absolute_layout_within_border()
{
CSSNode root = new CSSNode();
root.SetMargin(CSSEdge.Left, 10f);
root.SetMargin(CSSEdge.Top, 10f);
root.SetMargin(CSSEdge.Right, 10f);
root.SetMargin(CSSEdge.Bottom, 10f);
root.SetPadding(CSSEdge.Left, 10f);
root.SetPadding(CSSEdge.Top, 10f);
root.SetPadding(CSSEdge.Right, 10f);
root.SetPadding(CSSEdge.Bottom, 10f);
root.SetBorder(CSSEdge.Left, 10f);
root.SetBorder(CSSEdge.Top, 10f);
root.SetBorder(CSSEdge.Right, 10f);
root.SetBorder(CSSEdge.Bottom, 10f);
root.SetMargin(YogaEdge.Left, 10f);
root.SetMargin(YogaEdge.Top, 10f);
root.SetMargin(YogaEdge.Right, 10f);
root.SetMargin(YogaEdge.Bottom, 10f);
root.SetPadding(YogaEdge.Left, 10f);
root.SetPadding(YogaEdge.Top, 10f);
root.SetPadding(YogaEdge.Right, 10f);
root.SetPadding(YogaEdge.Bottom, 10f);
root.SetBorder(YogaEdge.Left, 10f);
root.SetBorder(YogaEdge.Top, 10f);
root.SetBorder(YogaEdge.Right, 10f);
root.SetBorder(YogaEdge.Bottom, 10f);
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.PositionType = CSSPositionType.Absolute;
root_child0.SetPosition(CSSEdge.Left, 0f);
root_child0.SetPosition(CSSEdge.Top, 0f);
root_child0.PositionType = YogaPositionType.Absolute;
root_child0.SetPosition(YogaEdge.Left, 0f);
root_child0.SetPosition(YogaEdge.Top, 0f);
root_child0.Width = 50f;
root_child0.Height = 50f;
root.Insert(0, root_child0);
CSSNode root_child1 = new CSSNode();
root_child1.PositionType = CSSPositionType.Absolute;
root_child1.SetPosition(CSSEdge.Right, 0f);
root_child1.SetPosition(CSSEdge.Bottom, 0f);
root_child1.PositionType = YogaPositionType.Absolute;
root_child1.SetPosition(YogaEdge.Right, 0f);
root_child1.SetPosition(YogaEdge.Bottom, 0f);
root_child1.Width = 50f;
root_child1.Height = 50f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(10f, root.LayoutX);
@@ -291,7 +291,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child1.LayoutWidth);
Assert.AreEqual(50f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(10f, root.LayoutX);

View File

@@ -21,7 +21,7 @@ namespace Facebook.CSSLayout
public void Test_align_content_flex_start()
{
CSSNode root = new CSSNode();
root.Wrap = CSSWrap.Wrap;
root.Wrap = YogaWrap.Wrap;
root.Width = 100f;
root.Height = 100f;
@@ -49,7 +49,7 @@ namespace Facebook.CSSLayout
root_child4.Width = 50f;
root_child4.Height = 10f;
root.Insert(4, root_child4);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -82,7 +82,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child4.LayoutWidth);
Assert.AreEqual(10f, root_child4.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -120,8 +120,8 @@ namespace Facebook.CSSLayout
public void Test_align_content_flex_end()
{
CSSNode root = new CSSNode();
root.AlignContent = CSSAlign.FlexEnd;
root.Wrap = CSSWrap.Wrap;
root.AlignContent = YogaAlign.FlexEnd;
root.Wrap = YogaWrap.Wrap;
root.Width = 100f;
root.Height = 100f;
@@ -149,7 +149,7 @@ namespace Facebook.CSSLayout
root_child4.Width = 50f;
root_child4.Height = 10f;
root.Insert(4, root_child4);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -182,7 +182,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child4.LayoutWidth);
Assert.AreEqual(10f, root_child4.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -220,8 +220,8 @@ namespace Facebook.CSSLayout
public void Test_align_content_center()
{
CSSNode root = new CSSNode();
root.AlignContent = CSSAlign.Center;
root.Wrap = CSSWrap.Wrap;
root.AlignContent = YogaAlign.Center;
root.Wrap = YogaWrap.Wrap;
root.Width = 100f;
root.Height = 100f;
@@ -249,7 +249,7 @@ namespace Facebook.CSSLayout
root_child4.Width = 50f;
root_child4.Height = 10f;
root.Insert(4, root_child4);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -282,7 +282,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child4.LayoutWidth);
Assert.AreEqual(10f, root_child4.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -320,8 +320,8 @@ namespace Facebook.CSSLayout
public void Test_align_content_stretch()
{
CSSNode root = new CSSNode();
root.AlignContent = CSSAlign.Stretch;
root.Wrap = CSSWrap.Wrap;
root.AlignContent = YogaAlign.Stretch;
root.Wrap = YogaWrap.Wrap;
root.Width = 100f;
root.Height = 100f;
@@ -344,7 +344,7 @@ namespace Facebook.CSSLayout
CSSNode root_child4 = new CSSNode();
root_child4.Width = 50f;
root.Insert(4, root_child4);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -377,7 +377,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child4.LayoutWidth);
Assert.AreEqual(0f, root_child4.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -27,7 +27,7 @@ namespace Facebook.CSSLayout
CSSNode root_child0 = new CSSNode();
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -40,7 +40,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -58,7 +58,7 @@ namespace Facebook.CSSLayout
public void Test_align_items_center()
{
CSSNode root = new CSSNode();
root.AlignItems = CSSAlign.Center;
root.AlignItems = YogaAlign.Center;
root.Width = 100f;
root.Height = 100f;
@@ -66,7 +66,7 @@ namespace Facebook.CSSLayout
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -79,7 +79,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -97,7 +97,7 @@ namespace Facebook.CSSLayout
public void Test_align_items_flex_start()
{
CSSNode root = new CSSNode();
root.AlignItems = CSSAlign.FlexStart;
root.AlignItems = YogaAlign.FlexStart;
root.Width = 100f;
root.Height = 100f;
@@ -105,7 +105,7 @@ namespace Facebook.CSSLayout
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -118,7 +118,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -136,7 +136,7 @@ namespace Facebook.CSSLayout
public void Test_align_items_flex_end()
{
CSSNode root = new CSSNode();
root.AlignItems = CSSAlign.FlexEnd;
root.AlignItems = YogaAlign.FlexEnd;
root.Width = 100f;
root.Height = 100f;
@@ -144,7 +144,7 @@ namespace Facebook.CSSLayout
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -157,7 +157,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -25,11 +25,11 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.AlignSelf = CSSAlign.Center;
root_child0.AlignSelf = YogaAlign.Center;
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -42,7 +42,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -64,11 +64,11 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.AlignSelf = CSSAlign.FlexEnd;
root_child0.AlignSelf = YogaAlign.FlexEnd;
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -81,7 +81,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -103,11 +103,11 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.AlignSelf = CSSAlign.FlexStart;
root_child0.AlignSelf = YogaAlign.FlexStart;
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -120,7 +120,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -138,16 +138,16 @@ namespace Facebook.CSSLayout
public void Test_align_self_flex_end_override_flex_start()
{
CSSNode root = new CSSNode();
root.AlignItems = CSSAlign.FlexStart;
root.AlignItems = YogaAlign.FlexStart;
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.AlignSelf = CSSAlign.FlexEnd;
root_child0.AlignSelf = YogaAlign.FlexEnd;
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -160,7 +160,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -21,11 +21,11 @@ namespace Facebook.CSSLayout
public void Test_border_no_size()
{
CSSNode root = new CSSNode();
root.SetBorder(CSSEdge.Left, 10f);
root.SetBorder(CSSEdge.Top, 10f);
root.SetBorder(CSSEdge.Right, 10f);
root.SetBorder(CSSEdge.Bottom, 10f);
root.StyleDirection = CSSDirection.LTR;
root.SetBorder(YogaEdge.Left, 10f);
root.SetBorder(YogaEdge.Top, 10f);
root.SetBorder(YogaEdge.Right, 10f);
root.SetBorder(YogaEdge.Bottom, 10f);
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -33,7 +33,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(20f, root.LayoutWidth);
Assert.AreEqual(20f, root.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -46,16 +46,16 @@ namespace Facebook.CSSLayout
public void Test_border_container_match_child()
{
CSSNode root = new CSSNode();
root.SetBorder(CSSEdge.Left, 10f);
root.SetBorder(CSSEdge.Top, 10f);
root.SetBorder(CSSEdge.Right, 10f);
root.SetBorder(CSSEdge.Bottom, 10f);
root.SetBorder(YogaEdge.Left, 10f);
root.SetBorder(YogaEdge.Top, 10f);
root.SetBorder(YogaEdge.Right, 10f);
root.SetBorder(YogaEdge.Bottom, 10f);
CSSNode root_child0 = new CSSNode();
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -68,7 +68,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -86,10 +86,10 @@ namespace Facebook.CSSLayout
public void Test_border_flex_child()
{
CSSNode root = new CSSNode();
root.SetBorder(CSSEdge.Left, 10f);
root.SetBorder(CSSEdge.Top, 10f);
root.SetBorder(CSSEdge.Right, 10f);
root.SetBorder(CSSEdge.Bottom, 10f);
root.SetBorder(YogaEdge.Left, 10f);
root.SetBorder(YogaEdge.Top, 10f);
root.SetBorder(YogaEdge.Right, 10f);
root.SetBorder(YogaEdge.Bottom, 10f);
root.Width = 100f;
root.Height = 100f;
@@ -97,7 +97,7 @@ namespace Facebook.CSSLayout
root_child0.FlexGrow = 1f;
root_child0.Width = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -110,7 +110,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(80f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -128,17 +128,17 @@ namespace Facebook.CSSLayout
public void Test_border_stretch_child()
{
CSSNode root = new CSSNode();
root.SetBorder(CSSEdge.Left, 10f);
root.SetBorder(CSSEdge.Top, 10f);
root.SetBorder(CSSEdge.Right, 10f);
root.SetBorder(CSSEdge.Bottom, 10f);
root.SetBorder(YogaEdge.Left, 10f);
root.SetBorder(YogaEdge.Top, 10f);
root.SetBorder(YogaEdge.Right, 10f);
root.SetBorder(YogaEdge.Bottom, 10f);
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -151,7 +151,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(80f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -169,11 +169,11 @@ namespace Facebook.CSSLayout
public void Test_border_center_child()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.Center;
root.AlignItems = CSSAlign.Center;
root.SetBorder(CSSEdge.Start, 10f);
root.SetBorder(CSSEdge.End, 20f);
root.SetBorder(CSSEdge.Bottom, 20f);
root.JustifyContent = YogaJustify.Center;
root.AlignItems = YogaAlign.Center;
root.SetBorder(YogaEdge.Start, 10f);
root.SetBorder(YogaEdge.End, 20f);
root.SetBorder(YogaEdge.Bottom, 20f);
root.Width = 100f;
root.Height = 100f;
@@ -181,7 +181,7 @@ namespace Facebook.CSSLayout
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -194,7 +194,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -34,7 +34,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -57,7 +57,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(10f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -85,7 +85,7 @@ namespace Facebook.CSSLayout
public void Test_flex_direction_row_no_width()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
@@ -99,7 +99,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Width = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -122,7 +122,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child2.LayoutWidth);
Assert.AreEqual(100f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -164,7 +164,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -187,7 +187,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(10f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -215,7 +215,7 @@ namespace Facebook.CSSLayout
public void Test_flex_direction_row()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
@@ -230,7 +230,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Width = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -253,7 +253,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child2.LayoutWidth);
Assert.AreEqual(100f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -281,7 +281,7 @@ namespace Facebook.CSSLayout
public void Test_flex_direction_column_reverse()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.ColumnReverse;
root.FlexDirection = YogaFlexDirection.ColumnReverse;
root.Width = 100f;
root.Height = 100f;
@@ -296,7 +296,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -319,7 +319,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(10f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -347,7 +347,7 @@ namespace Facebook.CSSLayout
public void Test_flex_direction_row_reverse()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.RowReverse;
root.FlexDirection = YogaFlexDirection.RowReverse;
root.Width = 100f;
root.Height = 100f;
@@ -362,7 +362,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Width = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -385,7 +385,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child2.LayoutWidth);
Assert.AreEqual(100f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -32,7 +32,7 @@ namespace Facebook.CSSLayout
CSSNode root_child1 = new CSSNode();
root_child1.FlexGrow = 1f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -50,7 +50,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child1.LayoutWidth);
Assert.AreEqual(25f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -73,7 +73,7 @@ namespace Facebook.CSSLayout
public void Test_flex_basis_flex_grow_row()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
@@ -85,7 +85,7 @@ namespace Facebook.CSSLayout
CSSNode root_child1 = new CSSNode();
root_child1.FlexGrow = 1f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -103,7 +103,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(25f, root_child1.LayoutWidth);
Assert.AreEqual(100f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -137,7 +137,7 @@ namespace Facebook.CSSLayout
CSSNode root_child1 = new CSSNode();
root_child1.FlexBasis = 50f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -155,7 +155,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child1.LayoutWidth);
Assert.AreEqual(50f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -178,7 +178,7 @@ namespace Facebook.CSSLayout
public void Test_flex_basis_flex_shrink_row()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
@@ -190,7 +190,7 @@ namespace Facebook.CSSLayout
CSSNode root_child1 = new CSSNode();
root_child1.FlexBasis = 50f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -208,7 +208,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child1.LayoutWidth);
Assert.AreEqual(100f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -248,7 +248,7 @@ namespace Facebook.CSSLayout
root_child2.Width = 50f;
root_child2.Height = 50f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -271,7 +271,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child2.LayoutWidth);
Assert.AreEqual(50f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -317,7 +317,7 @@ namespace Facebook.CSSLayout
root_child2.FlexGrow = 1f;
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -340,7 +340,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(20f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -378,7 +378,7 @@ namespace Facebook.CSSLayout
root_child0_child0.FlexGrow = 1f;
root_child0_child0.FlexShrink = 1f;
root_child0.Insert(0, root_child0_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -396,7 +396,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0_child0.LayoutWidth);
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -21,7 +21,7 @@ namespace Facebook.CSSLayout
public void Test_wrap_column()
{
CSSNode root = new CSSNode();
root.Wrap = CSSWrap.Wrap;
root.Wrap = YogaWrap.Wrap;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
@@ -43,7 +43,7 @@ namespace Facebook.CSSLayout
root_child3.Width = 30f;
root_child3.Height = 30f;
root.Insert(3, root_child3);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -71,7 +71,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(30f, root_child3.LayoutWidth);
Assert.AreEqual(30f, root_child3.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -104,8 +104,8 @@ namespace Facebook.CSSLayout
public void Test_wrap_row()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.Wrap = CSSWrap.Wrap;
root.FlexDirection = YogaFlexDirection.Row;
root.Wrap = YogaWrap.Wrap;
root.Width = 100f;
CSSNode root_child0 = new CSSNode();
@@ -127,7 +127,7 @@ namespace Facebook.CSSLayout
root_child3.Width = 30f;
root_child3.Height = 30f;
root.Insert(3, root_child3);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -155,7 +155,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(30f, root_child3.LayoutWidth);
Assert.AreEqual(30f, root_child3.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -188,9 +188,9 @@ namespace Facebook.CSSLayout
public void Test_wrap_row_align_items_flex_end()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.AlignItems = CSSAlign.FlexEnd;
root.Wrap = CSSWrap.Wrap;
root.FlexDirection = YogaFlexDirection.Row;
root.AlignItems = YogaAlign.FlexEnd;
root.Wrap = YogaWrap.Wrap;
root.Width = 100f;
CSSNode root_child0 = new CSSNode();
@@ -212,7 +212,7 @@ namespace Facebook.CSSLayout
root_child3.Width = 30f;
root_child3.Height = 30f;
root.Insert(3, root_child3);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -240,7 +240,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(30f, root_child3.LayoutWidth);
Assert.AreEqual(30f, root_child3.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -273,9 +273,9 @@ namespace Facebook.CSSLayout
public void Test_wrap_row_align_items_center()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.AlignItems = CSSAlign.Center;
root.Wrap = CSSWrap.Wrap;
root.FlexDirection = YogaFlexDirection.Row;
root.AlignItems = YogaAlign.Center;
root.Wrap = YogaWrap.Wrap;
root.Width = 100f;
CSSNode root_child0 = new CSSNode();
@@ -297,7 +297,7 @@ namespace Facebook.CSSLayout
root_child3.Width = 30f;
root_child3.Height = 30f;
root.Insert(3, root_child3);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -325,7 +325,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(30f, root_child3.LayoutWidth);
Assert.AreEqual(30f, root_child3.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -21,7 +21,7 @@ namespace Facebook.CSSLayout
public void Test_justify_content_row_flex_start()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 102f;
root.Height = 102f;
@@ -36,7 +36,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Width = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -59,7 +59,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child2.LayoutWidth);
Assert.AreEqual(102f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -87,8 +87,8 @@ namespace Facebook.CSSLayout
public void Test_justify_content_row_flex_end()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.JustifyContent = CSSJustify.FlexEnd;
root.FlexDirection = YogaFlexDirection.Row;
root.JustifyContent = YogaJustify.FlexEnd;
root.Width = 102f;
root.Height = 102f;
@@ -103,7 +103,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Width = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -126,7 +126,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child2.LayoutWidth);
Assert.AreEqual(102f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -154,8 +154,8 @@ namespace Facebook.CSSLayout
public void Test_justify_content_row_center()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.JustifyContent = CSSJustify.Center;
root.FlexDirection = YogaFlexDirection.Row;
root.JustifyContent = YogaJustify.Center;
root.Width = 102f;
root.Height = 102f;
@@ -170,7 +170,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Width = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -193,7 +193,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child2.LayoutWidth);
Assert.AreEqual(102f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -221,8 +221,8 @@ namespace Facebook.CSSLayout
public void Test_justify_content_row_space_between()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.JustifyContent = CSSJustify.SpaceBetween;
root.FlexDirection = YogaFlexDirection.Row;
root.JustifyContent = YogaJustify.SpaceBetween;
root.Width = 102f;
root.Height = 102f;
@@ -237,7 +237,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Width = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -260,7 +260,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child2.LayoutWidth);
Assert.AreEqual(102f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -288,8 +288,8 @@ namespace Facebook.CSSLayout
public void Test_justify_content_row_space_around()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.JustifyContent = CSSJustify.SpaceAround;
root.FlexDirection = YogaFlexDirection.Row;
root.JustifyContent = YogaJustify.SpaceAround;
root.Width = 102f;
root.Height = 102f;
@@ -304,7 +304,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Width = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -327,7 +327,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child2.LayoutWidth);
Assert.AreEqual(102f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -368,7 +368,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -391,7 +391,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(102f, root_child2.LayoutWidth);
Assert.AreEqual(10f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -419,7 +419,7 @@ namespace Facebook.CSSLayout
public void Test_justify_content_column_flex_end()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.FlexEnd;
root.JustifyContent = YogaJustify.FlexEnd;
root.Width = 102f;
root.Height = 102f;
@@ -434,7 +434,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -457,7 +457,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(102f, root_child2.LayoutWidth);
Assert.AreEqual(10f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -485,7 +485,7 @@ namespace Facebook.CSSLayout
public void Test_justify_content_column_center()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.Center;
root.JustifyContent = YogaJustify.Center;
root.Width = 102f;
root.Height = 102f;
@@ -500,7 +500,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -523,7 +523,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(102f, root_child2.LayoutWidth);
Assert.AreEqual(10f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -551,7 +551,7 @@ namespace Facebook.CSSLayout
public void Test_justify_content_column_space_between()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.SpaceBetween;
root.JustifyContent = YogaJustify.SpaceBetween;
root.Width = 102f;
root.Height = 102f;
@@ -566,7 +566,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -589,7 +589,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(102f, root_child2.LayoutWidth);
Assert.AreEqual(10f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -617,7 +617,7 @@ namespace Facebook.CSSLayout
public void Test_justify_content_column_space_around()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.SpaceAround;
root.JustifyContent = YogaJustify.SpaceAround;
root.Width = 102f;
root.Height = 102f;
@@ -632,7 +632,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -655,7 +655,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(102f, root_child2.LayoutWidth);
Assert.AreEqual(10f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -21,15 +21,15 @@ namespace Facebook.CSSLayout
public void Test_margin_start()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.SetMargin(CSSEdge.Start, 10f);
root_child0.SetMargin(YogaEdge.Start, 10f);
root_child0.Width = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -42,7 +42,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(100f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -64,10 +64,10 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.SetMargin(CSSEdge.Top, 10f);
root_child0.SetMargin(YogaEdge.Top, 10f);
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -80,7 +80,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -98,16 +98,16 @@ namespace Facebook.CSSLayout
public void Test_margin_end()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.JustifyContent = CSSJustify.FlexEnd;
root.FlexDirection = YogaFlexDirection.Row;
root.JustifyContent = YogaJustify.FlexEnd;
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.SetMargin(CSSEdge.End, 10f);
root_child0.SetMargin(YogaEdge.End, 10f);
root_child0.Width = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -120,7 +120,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(100f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -138,15 +138,15 @@ namespace Facebook.CSSLayout
public void Test_margin_bottom()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.FlexEnd;
root.JustifyContent = YogaJustify.FlexEnd;
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.SetMargin(CSSEdge.Bottom, 10f);
root_child0.SetMargin(YogaEdge.Bottom, 10f);
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -159,7 +159,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -177,15 +177,15 @@ namespace Facebook.CSSLayout
public void Test_margin_and_flex_row()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.FlexGrow = 1f;
root_child0.SetMargin(CSSEdge.Start, 10f);
root_child0.SetMargin(YogaEdge.Start, 10f);
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -198,7 +198,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(90f, root_child0.LayoutWidth);
Assert.AreEqual(100f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -221,9 +221,9 @@ namespace Facebook.CSSLayout
CSSNode root_child0 = new CSSNode();
root_child0.FlexGrow = 1f;
root_child0.SetMargin(CSSEdge.Top, 10f);
root_child0.SetMargin(YogaEdge.Top, 10f);
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -236,7 +236,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0.LayoutWidth);
Assert.AreEqual(90f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -254,15 +254,15 @@ namespace Facebook.CSSLayout
public void Test_margin_and_stretch_row()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.FlexGrow = 1f;
root_child0.SetMargin(CSSEdge.Top, 10f);
root_child0.SetMargin(YogaEdge.Top, 10f);
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -275,7 +275,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0.LayoutWidth);
Assert.AreEqual(90f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -298,9 +298,9 @@ namespace Facebook.CSSLayout
CSSNode root_child0 = new CSSNode();
root_child0.FlexGrow = 1f;
root_child0.SetMargin(CSSEdge.Start, 10f);
root_child0.SetMargin(YogaEdge.Start, 10f);
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -313,7 +313,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(90f, root_child0.LayoutWidth);
Assert.AreEqual(100f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -331,7 +331,7 @@ namespace Facebook.CSSLayout
public void Test_margin_with_sibling_row()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
@@ -342,7 +342,7 @@ namespace Facebook.CSSLayout
CSSNode root_child1 = new CSSNode();
root_child1.FlexGrow = 1f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -360,7 +360,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child1.LayoutWidth);
Assert.AreEqual(100f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -393,7 +393,7 @@ namespace Facebook.CSSLayout
CSSNode root_child1 = new CSSNode();
root_child1.FlexGrow = 1f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -411,7 +411,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child1.LayoutWidth);
Assert.AreEqual(50f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -28,7 +28,7 @@ namespace Facebook.CSSLayout
root_child0.MaxWidth = 50f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -41,7 +41,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -59,7 +59,7 @@ namespace Facebook.CSSLayout
public void Test_max_height()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
@@ -67,7 +67,7 @@ namespace Facebook.CSSLayout
root_child0.Width = 10f;
root_child0.MaxHeight = 50f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -80,7 +80,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(50f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -109,7 +109,7 @@ namespace Facebook.CSSLayout
CSSNode root_child1 = new CSSNode();
root_child1.FlexGrow = 1f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -127,7 +127,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child1.LayoutWidth);
Assert.AreEqual(20f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -150,7 +150,7 @@ namespace Facebook.CSSLayout
public void Test_min_width()
{
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
@@ -162,7 +162,7 @@ namespace Facebook.CSSLayout
CSSNode root_child1 = new CSSNode();
root_child1.FlexGrow = 1f;
root.Insert(1, root_child1);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -180,7 +180,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(20f, root_child1.LayoutWidth);
Assert.AreEqual(100f, root_child1.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -203,7 +203,7 @@ namespace Facebook.CSSLayout
public void Test_justify_content_min_max()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.Center;
root.JustifyContent = YogaJustify.Center;
root.Width = 100f;
root.MinHeight = 100f;
root.MaxHeight = 200f;
@@ -212,7 +212,7 @@ namespace Facebook.CSSLayout
root_child0.Width = 60f;
root_child0.Height = 60f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -225,7 +225,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(60f, root_child0.LayoutWidth);
Assert.AreEqual(60f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -243,7 +243,7 @@ namespace Facebook.CSSLayout
public void Test_align_items_min_max()
{
CSSNode root = new CSSNode();
root.AlignItems = CSSAlign.Center;
root.AlignItems = YogaAlign.Center;
root.MinWidth = 100f;
root.MaxWidth = 200f;
root.Height = 100f;
@@ -252,7 +252,7 @@ namespace Facebook.CSSLayout
root_child0.Width = 60f;
root_child0.Height = 60f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -265,7 +265,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(60f, root_child0.LayoutWidth);
Assert.AreEqual(60f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -283,7 +283,7 @@ namespace Facebook.CSSLayout
public void Test_justify_content_overflow_min_max()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.Center;
root.JustifyContent = YogaJustify.Center;
root.MinHeight = 100f;
root.MaxHeight = 110f;
@@ -301,7 +301,7 @@ namespace Facebook.CSSLayout
root_child2.Width = 50f;
root_child2.Height = 50f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -324,7 +324,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(50f, root_child2.LayoutWidth);
Assert.AreEqual(50f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -356,7 +356,7 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.FlexDirection = CSSFlexDirection.Row;
root_child0.FlexDirection = YogaFlexDirection.Row;
root_child0.MaxWidth = 100f;
root.Insert(0, root_child0);
@@ -364,7 +364,7 @@ namespace Facebook.CSSLayout
root_child0_child0.FlexGrow = 1f;
root_child0_child0.Height = 20f;
root_child0.Insert(0, root_child0_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -382,7 +382,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0_child0.LayoutWidth);
Assert.AreEqual(20f, root_child0_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -409,7 +409,7 @@ namespace Facebook.CSSLayout
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.FlexDirection = CSSFlexDirection.Row;
root_child0.FlexDirection = YogaFlexDirection.Row;
root_child0.MaxWidth = 300f;
root.Insert(0, root_child0);
@@ -417,7 +417,7 @@ namespace Facebook.CSSLayout
root_child0_child0.FlexGrow = 1f;
root_child0_child0.Height = 20f;
root_child0.Insert(0, root_child0_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -435,7 +435,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(200f, root_child0_child0.LayoutWidth);
Assert.AreEqual(20f, root_child0_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -21,11 +21,11 @@ namespace Facebook.CSSLayout
public void Test_padding_no_size()
{
CSSNode root = new CSSNode();
root.SetPadding(CSSEdge.Left, 10f);
root.SetPadding(CSSEdge.Top, 10f);
root.SetPadding(CSSEdge.Right, 10f);
root.SetPadding(CSSEdge.Bottom, 10f);
root.StyleDirection = CSSDirection.LTR;
root.SetPadding(YogaEdge.Left, 10f);
root.SetPadding(YogaEdge.Top, 10f);
root.SetPadding(YogaEdge.Right, 10f);
root.SetPadding(YogaEdge.Bottom, 10f);
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -33,7 +33,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(20f, root.LayoutWidth);
Assert.AreEqual(20f, root.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -46,16 +46,16 @@ namespace Facebook.CSSLayout
public void Test_padding_container_match_child()
{
CSSNode root = new CSSNode();
root.SetPadding(CSSEdge.Left, 10f);
root.SetPadding(CSSEdge.Top, 10f);
root.SetPadding(CSSEdge.Right, 10f);
root.SetPadding(CSSEdge.Bottom, 10f);
root.SetPadding(YogaEdge.Left, 10f);
root.SetPadding(YogaEdge.Top, 10f);
root.SetPadding(YogaEdge.Right, 10f);
root.SetPadding(YogaEdge.Bottom, 10f);
CSSNode root_child0 = new CSSNode();
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -68,7 +68,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -86,10 +86,10 @@ namespace Facebook.CSSLayout
public void Test_padding_flex_child()
{
CSSNode root = new CSSNode();
root.SetPadding(CSSEdge.Left, 10f);
root.SetPadding(CSSEdge.Top, 10f);
root.SetPadding(CSSEdge.Right, 10f);
root.SetPadding(CSSEdge.Bottom, 10f);
root.SetPadding(YogaEdge.Left, 10f);
root.SetPadding(YogaEdge.Top, 10f);
root.SetPadding(YogaEdge.Right, 10f);
root.SetPadding(YogaEdge.Bottom, 10f);
root.Width = 100f;
root.Height = 100f;
@@ -97,7 +97,7 @@ namespace Facebook.CSSLayout
root_child0.FlexGrow = 1f;
root_child0.Width = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -110,7 +110,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(80f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -128,17 +128,17 @@ namespace Facebook.CSSLayout
public void Test_padding_stretch_child()
{
CSSNode root = new CSSNode();
root.SetPadding(CSSEdge.Left, 10f);
root.SetPadding(CSSEdge.Top, 10f);
root.SetPadding(CSSEdge.Right, 10f);
root.SetPadding(CSSEdge.Bottom, 10f);
root.SetPadding(YogaEdge.Left, 10f);
root.SetPadding(YogaEdge.Top, 10f);
root.SetPadding(YogaEdge.Right, 10f);
root.SetPadding(YogaEdge.Bottom, 10f);
root.Width = 100f;
root.Height = 100f;
CSSNode root_child0 = new CSSNode();
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -151,7 +151,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(80f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -169,11 +169,11 @@ namespace Facebook.CSSLayout
public void Test_padding_center_child()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.Center;
root.AlignItems = CSSAlign.Center;
root.SetPadding(CSSEdge.Start, 10f);
root.SetPadding(CSSEdge.End, 20f);
root.SetPadding(CSSEdge.Bottom, 20f);
root.JustifyContent = YogaJustify.Center;
root.AlignItems = YogaAlign.Center;
root.SetPadding(YogaEdge.Start, 10f);
root.SetPadding(YogaEdge.End, 20f);
root.SetPadding(YogaEdge.Bottom, 20f);
root.Width = 100f;
root.Height = 100f;
@@ -181,7 +181,7 @@ namespace Facebook.CSSLayout
root_child0.Width = 10f;
root_child0.Height = 10f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -194,7 +194,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(10f, root_child0.LayoutWidth);
Assert.AreEqual(10f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -212,20 +212,20 @@ namespace Facebook.CSSLayout
public void Test_child_with_padding_align_end()
{
CSSNode root = new CSSNode();
root.JustifyContent = CSSJustify.FlexEnd;
root.AlignItems = CSSAlign.FlexEnd;
root.JustifyContent = YogaJustify.FlexEnd;
root.AlignItems = YogaAlign.FlexEnd;
root.Width = 200f;
root.Height = 200f;
CSSNode root_child0 = new CSSNode();
root_child0.SetPadding(CSSEdge.Left, 20f);
root_child0.SetPadding(CSSEdge.Top, 20f);
root_child0.SetPadding(CSSEdge.Right, 20f);
root_child0.SetPadding(CSSEdge.Bottom, 20f);
root_child0.SetPadding(YogaEdge.Left, 20f);
root_child0.SetPadding(YogaEdge.Top, 20f);
root_child0.SetPadding(YogaEdge.Right, 20f);
root_child0.SetPadding(YogaEdge.Bottom, 20f);
root_child0.Width = 100f;
root_child0.Height = 100f;
root.Insert(0, root_child0);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -238,7 +238,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child0.LayoutWidth);
Assert.AreEqual(100f, root_child0.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);

View File

@@ -20,10 +20,10 @@ namespace Facebook.CSSLayout
[Test]
public void Test_rounding_flex_basis_flex_grow_row_width_of_100()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 100f;
root.Height = 100f;
@@ -38,7 +38,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.FlexGrow = 1f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -61,7 +61,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(33f, root_child2.LayoutWidth);
Assert.AreEqual(100f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -84,16 +84,16 @@ namespace Facebook.CSSLayout
Assert.AreEqual(33f, root_child2.LayoutWidth);
Assert.AreEqual(100f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_flex_basis_flex_grow_row_prime_number_width()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 113f;
root.Height = 100f;
@@ -116,7 +116,7 @@ namespace Facebook.CSSLayout
CSSNode root_child4 = new CSSNode();
root_child4.FlexGrow = 1f;
root.Insert(4, root_child4);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -149,7 +149,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(23f, root_child4.LayoutWidth);
Assert.AreEqual(100f, root_child4.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -182,16 +182,16 @@ namespace Facebook.CSSLayout
Assert.AreEqual(23f, root_child4.LayoutWidth);
Assert.AreEqual(100f, root_child4.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_flex_basis_flex_shrink_row()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.FlexDirection = CSSFlexDirection.Row;
root.FlexDirection = YogaFlexDirection.Row;
root.Width = 101f;
root.Height = 100f;
@@ -207,7 +207,7 @@ namespace Facebook.CSSLayout
CSSNode root_child2 = new CSSNode();
root_child2.FlexBasis = 25f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -230,7 +230,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(25f, root_child2.LayoutWidth);
Assert.AreEqual(100f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -253,13 +253,13 @@ namespace Facebook.CSSLayout
Assert.AreEqual(25f, root_child2.LayoutWidth);
Assert.AreEqual(100f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_flex_basis_overrides_main_size()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.Width = 100f;
@@ -280,7 +280,7 @@ namespace Facebook.CSSLayout
root_child2.FlexGrow = 1f;
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -303,7 +303,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -326,13 +326,13 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_total_fractial()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.Width = 87.4f;
@@ -353,7 +353,7 @@ namespace Facebook.CSSLayout
root_child2.FlexGrow = 1.1f;
root_child2.Height = 10.7f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -376,7 +376,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(87f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -399,13 +399,13 @@ namespace Facebook.CSSLayout
Assert.AreEqual(87f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_total_fractial_nested()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.Width = 87.4f;
@@ -420,14 +420,14 @@ namespace Facebook.CSSLayout
CSSNode root_child0_child0 = new CSSNode();
root_child0_child0.FlexGrow = 1f;
root_child0_child0.FlexBasis = 0.3f;
root_child0_child0.SetPosition(CSSEdge.Bottom, 13.3f);
root_child0_child0.SetPosition(YogaEdge.Bottom, 13.3f);
root_child0_child0.Height = 9.9f;
root_child0.Insert(0, root_child0_child0);
CSSNode root_child0_child1 = new CSSNode();
root_child0_child1.FlexGrow = 4f;
root_child0_child1.FlexBasis = 0.3f;
root_child0_child1.SetPosition(CSSEdge.Top, 13.3f);
root_child0_child1.SetPosition(YogaEdge.Top, 13.3f);
root_child0_child1.Height = 1.1f;
root_child0.Insert(1, root_child0_child1);
@@ -440,7 +440,7 @@ namespace Facebook.CSSLayout
root_child2.FlexGrow = 1.1f;
root_child2.Height = 10.7f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -473,7 +473,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(87f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -506,13 +506,13 @@ namespace Facebook.CSSLayout
Assert.AreEqual(87f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_fractial_input_1()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.Width = 100f;
@@ -533,7 +533,7 @@ namespace Facebook.CSSLayout
root_child2.FlexGrow = 1f;
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -556,7 +556,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -579,13 +579,13 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_fractial_input_2()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.Width = 100f;
@@ -606,7 +606,7 @@ namespace Facebook.CSSLayout
root_child2.FlexGrow = 1f;
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -629,7 +629,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(25f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -652,16 +652,16 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(25f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_fractial_input_3()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.SetPosition(CSSEdge.Top, 0.3f);
root.SetPosition(YogaEdge.Top, 0.3f);
root.Width = 100f;
root.Height = 113.4f;
@@ -680,7 +680,7 @@ namespace Facebook.CSSLayout
root_child2.FlexGrow = 1f;
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -703,7 +703,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -726,16 +726,16 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
[Test]
public void Test_rounding_fractial_input_4()
{
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, true);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
CSSNode root = new CSSNode();
root.SetPosition(CSSEdge.Top, 0.7f);
root.SetPosition(YogaEdge.Top, 0.7f);
root.Width = 100f;
root.Height = 113.4f;
@@ -754,7 +754,7 @@ namespace Facebook.CSSLayout
root_child2.FlexGrow = 1f;
root_child2.Height = 10f;
root.Insert(2, root_child2);
root.StyleDirection = CSSDirection.LTR;
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -777,7 +777,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
root.StyleDirection = CSSDirection.RTL;
root.StyleDirection = YogaDirection.RTL;
root.CalculateLayout();
Assert.AreEqual(0f, root.LayoutX);
@@ -800,7 +800,7 @@ namespace Facebook.CSSLayout
Assert.AreEqual(100f, root_child2.LayoutWidth);
Assert.AreEqual(24f, root_child2.LayoutHeight);
CSSNode.SetExperimentalFeatureEnabled(CSSExperimentalFeature.Rounding, false);
CSSNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
}
}

View File

@@ -22,8 +22,8 @@ namespace Facebook.CSSLayout
public void TestSimple()
{
CSSNode nodeDefault = new CSSNode();
CSSNode nodeCreated = CSSNode.Create(flexDirection: CSSFlexDirection.Row);
Assert.AreEqual(CSSFlexDirection.Row, nodeCreated.FlexDirection);
CSSNode nodeCreated = CSSNode.Create(flexDirection: YogaFlexDirection.Row);
Assert.AreEqual(YogaFlexDirection.Row, nodeCreated.FlexDirection);
Assert.IsFalse(nodeDefault.IsDirty);
nodeDefault.CopyStyle(nodeCreated);
Assert.IsTrue(nodeDefault.IsDirty);
@@ -43,39 +43,39 @@ namespace Facebook.CSSLayout
public void TestMultiple()
{
CSSNode node = CSSNode.Create(
positionType: CSSPositionType.Absolute,
wrap: CSSWrap.Wrap,
positionType: YogaPositionType.Absolute,
wrap: YogaWrap.Wrap,
position: new Spacing(top:6, right:4),
margin: new Spacing(bottom:5, left:3));
Assert.AreEqual(CSSFlexDirection.Column, node.FlexDirection);
Assert.AreEqual(CSSPositionType.Absolute, node.PositionType);
Assert.AreEqual(CSSWrap.Wrap, node.Wrap);
Assert.AreEqual(6, node.GetPosition(CSSEdge.Top));
Assert.IsTrue(CSSConstants.IsUndefined(node.GetPosition(CSSEdge.Bottom)));
Assert.AreEqual(4, node.GetPosition(CSSEdge.Right));
Assert.IsTrue(CSSConstants.IsUndefined(node.GetPosition(CSSEdge.Left)));
Assert.AreEqual(0, node.GetMargin(CSSEdge.Top));
Assert.AreEqual(5, node.GetMargin(CSSEdge.Bottom));
Assert.AreEqual(3, node.GetMargin(CSSEdge.Left));
Assert.AreEqual(0, node.GetMargin(CSSEdge.Right));
Assert.AreEqual(YogaFlexDirection.Column, node.FlexDirection);
Assert.AreEqual(YogaPositionType.Absolute, node.PositionType);
Assert.AreEqual(YogaWrap.Wrap, node.Wrap);
Assert.AreEqual(6, node.GetPosition(YogaEdge.Top));
Assert.IsTrue(YogaConstants.IsUndefined(node.GetPosition(YogaEdge.Bottom)));
Assert.AreEqual(4, node.GetPosition(YogaEdge.Right));
Assert.IsTrue(YogaConstants.IsUndefined(node.GetPosition(YogaEdge.Left)));
Assert.AreEqual(0, node.GetMargin(YogaEdge.Top));
Assert.AreEqual(5, node.GetMargin(YogaEdge.Bottom));
Assert.AreEqual(3, node.GetMargin(YogaEdge.Left));
Assert.AreEqual(0, node.GetMargin(YogaEdge.Right));
}
[Test]
public void TestFull()
{
CSSNode node = CSSNode.Create(
styleDirection: CSSDirection.RTL,
flexDirection: CSSFlexDirection.RowReverse,
styleDirection: YogaDirection.RTL,
flexDirection: YogaFlexDirection.RowReverse,
justifyContent: CSSJustify.SpaceAround,
alignContent: CSSAlign.Center,
alignItems: CSSAlign.FlexEnd,
alignSelf: CSSAlign.Stretch,
justifyContent: YogaJustify.SpaceAround,
alignContent: YogaAlign.Center,
alignItems: YogaAlign.FlexEnd,
alignSelf: YogaAlign.Stretch,
positionType: CSSPositionType.Absolute,
wrap: CSSWrap.Wrap,
overflow: CSSOverflow.Scroll,
positionType: YogaPositionType.Absolute,
wrap: YogaWrap.Wrap,
overflow: YogaOverflow.Scroll,
flex: 1,
flexGrow: 2,
@@ -94,43 +94,43 @@ namespace Facebook.CSSLayout
maxWidth: 25,
maxHeight: 26);
Assert.AreEqual(CSSDirection.RTL, node.StyleDirection);
Assert.AreEqual(CSSFlexDirection.RowReverse, node.FlexDirection);
Assert.AreEqual(YogaDirection.RTL, node.StyleDirection);
Assert.AreEqual(YogaFlexDirection.RowReverse, node.FlexDirection);
Assert.AreEqual(CSSJustify.SpaceAround, node.JustifyContent);
Assert.AreEqual(CSSAlign.Center, node.AlignContent);
Assert.AreEqual(CSSAlign.FlexEnd, node.AlignItems);
Assert.AreEqual(CSSAlign.Stretch, node.AlignSelf);
Assert.AreEqual(YogaJustify.SpaceAround, node.JustifyContent);
Assert.AreEqual(YogaAlign.Center, node.AlignContent);
Assert.AreEqual(YogaAlign.FlexEnd, node.AlignItems);
Assert.AreEqual(YogaAlign.Stretch, node.AlignSelf);
Assert.AreEqual(CSSPositionType.Absolute, node.PositionType);
Assert.AreEqual(CSSWrap.Wrap, node.Wrap);
Assert.AreEqual(CSSOverflow.Scroll, node.Overflow);
Assert.AreEqual(YogaPositionType.Absolute, node.PositionType);
Assert.AreEqual(YogaWrap.Wrap, node.Wrap);
Assert.AreEqual(YogaOverflow.Scroll, node.Overflow);
Assert.AreEqual(2, node.FlexGrow);
Assert.AreEqual(3, node.FlexShrink);
Assert.AreEqual(4, node.FlexBasis);
node.FlexGrow = CSSConstants.Undefined;
node.FlexGrow = YogaConstants.Undefined;
Assert.AreEqual(1, node.FlexGrow);
Assert.AreEqual(5, node.GetPosition(CSSEdge.Top));
Assert.AreEqual(6, node.GetPosition(CSSEdge.Bottom));
Assert.AreEqual(7, node.GetPosition(CSSEdge.Left));
Assert.AreEqual(8, node.GetPosition(CSSEdge.Right));
Assert.AreEqual(5, node.GetPosition(YogaEdge.Top));
Assert.AreEqual(6, node.GetPosition(YogaEdge.Bottom));
Assert.AreEqual(7, node.GetPosition(YogaEdge.Left));
Assert.AreEqual(8, node.GetPosition(YogaEdge.Right));
Assert.AreEqual(9, node.GetMargin(CSSEdge.Top));
Assert.AreEqual(10, node.GetMargin(CSSEdge.Bottom));
Assert.AreEqual(11, node.GetMargin(CSSEdge.Left));
Assert.AreEqual(12, node.GetMargin(CSSEdge.Right));
Assert.AreEqual(9, node.GetMargin(YogaEdge.Top));
Assert.AreEqual(10, node.GetMargin(YogaEdge.Bottom));
Assert.AreEqual(11, node.GetMargin(YogaEdge.Left));
Assert.AreEqual(12, node.GetMargin(YogaEdge.Right));
Assert.AreEqual(13, node.GetPadding(CSSEdge.Top));
Assert.AreEqual(14, node.GetPadding(CSSEdge.Bottom));
Assert.AreEqual(15, node.GetPadding(CSSEdge.Left));
Assert.AreEqual(16, node.GetPadding(CSSEdge.Right));
Assert.AreEqual(13, node.GetPadding(YogaEdge.Top));
Assert.AreEqual(14, node.GetPadding(YogaEdge.Bottom));
Assert.AreEqual(15, node.GetPadding(YogaEdge.Left));
Assert.AreEqual(16, node.GetPadding(YogaEdge.Right));
Assert.AreEqual(17, node.GetBorder(CSSEdge.Top));
Assert.AreEqual(18, node.GetBorder(CSSEdge.Bottom));
Assert.AreEqual(19, node.GetBorder(CSSEdge.Left));
Assert.AreEqual(20, node.GetBorder(CSSEdge.Right));
Assert.AreEqual(17, node.GetBorder(YogaEdge.Top));
Assert.AreEqual(18, node.GetBorder(YogaEdge.Bottom));
Assert.AreEqual(19, node.GetBorder(YogaEdge.Left));
Assert.AreEqual(20, node.GetBorder(YogaEdge.Right));
Assert.AreEqual(21, node.Width);
Assert.AreEqual(22, node.Height);

View File

@@ -219,7 +219,7 @@ namespace Facebook.CSSLayout
public void TestCopyStyle()
{
CSSNode node0 = new CSSNode();
Assert.IsTrue(CSSConstants.IsUndefined(node0.MaxHeight));
Assert.IsTrue(YogaConstants.IsUndefined(node0.MaxHeight));
CSSNode node1 = new CSSNode();
node1.MaxHeight = 100;