Add aspectRatio style property

Summary: Implement aspect ratio as part of Yoga. Aspect ratio allows users of the library to specify the size of the undefined dimension in terms of an aspect ratio. See test cases for examples.

Reviewed By: gkassabli

Differential Revision: D4211458

fbshipit-source-id: f8d0d318369c7b529ee29e61a52b17d0cf3b396d
This commit is contained in:
Emil Sjolander
2016-11-21 10:12:26 -08:00
committed by Facebook Github Bot
parent b16c22a8f3
commit 55fc795686
9 changed files with 507 additions and 0 deletions

View File

@@ -364,6 +364,19 @@ namespace Facebook.CSSLayout
}
}
public float StyleAspectRatio
{
get
{
return Native.CSSNodeStyleGetAspectRatio(_cssNode);
}
set
{
Native.CSSNodeStyleSetAspectRatio(_cssNode, value);
}
}
public float LayoutX
{
get

View File

@@ -222,6 +222,12 @@ namespace Facebook.CSSLayout
[DllImport(DllName)]
public static extern float CSSNodeStyleGetMaxHeight(IntPtr node);
[DllImport(DllName)]
public static extern void CSSNodeStyleSetAspectRatio(IntPtr node, float aspectRatio);
[DllImport(DllName)]
public static extern float CSSNodeStyleGetAspectRatio(IntPtr node);
#endregion
#region CSS_NODE_STYLE_EDGE_PROPERTY