CSSNodeCopyStyle API for Java and C#
Summary: Add CopyStyle API for Java and C# Reviewed By: emilsjolander Differential Revision: D4189954 fbshipit-source-id: 10759fdb27bf67350d3151614f7815aa09bf7e04
This commit is contained in:
committed by
Facebook Github Bot
parent
191ac98b89
commit
0bb2955c5c
@@ -90,6 +90,11 @@ namespace Facebook.CSSLayout
|
||||
}
|
||||
}
|
||||
|
||||
public void CopyStyle(CSSNode srcNode)
|
||||
{
|
||||
Native.CSSNodeCopyStyle(_cssNode, srcNode._cssNode);
|
||||
}
|
||||
|
||||
public CSSDirection StyleDirection
|
||||
{
|
||||
get
|
||||
|
@@ -80,6 +80,9 @@ namespace Facebook.CSSLayout
|
||||
[return: MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CSSValueIsUndefined(float value);
|
||||
|
||||
[DllImport(DllName)]
|
||||
public static extern void CSSNodeCopyStyle(IntPtr dstNode, IntPtr srcNode);
|
||||
|
||||
#region CSS_NODE_PROPERTY
|
||||
|
||||
[DllImport(DllName)]
|
||||
|
@@ -215,13 +215,26 @@ namespace Facebook.CSSLayout
|
||||
Assert.AreEqual(parent.Print(), "{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100, height: 120, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35, height: 45, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30, height: 40, },\n]},\n");
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestCopyStyle()
|
||||
{
|
||||
CSSNode node0 = new CSSNode();
|
||||
Assert.IsTrue(CSSConstants.IsUndefined(node0.StyleMaxHeight));
|
||||
|
||||
CSSNode node1 = new CSSNode();
|
||||
node1.StyleMaxHeight = 100;
|
||||
|
||||
node0.CopyStyle(node1);
|
||||
Assert.AreEqual(100, node0.StyleMaxHeight);
|
||||
}
|
||||
|
||||
#if !UNITY_EDITOR
|
||||
private void ForceGC()
|
||||
{
|
||||
GC.Collect(GC.MaxGeneration);
|
||||
GC.WaitForPendingFinalizers();
|
||||
}
|
||||
|
||||
#if !UNITY_EDITOR
|
||||
[Test]
|
||||
public void TestDestructor()
|
||||
{
|
||||
|
Reference in New Issue
Block a user