Add C# bindings for Errata API #1259

Closed
NickGerleman wants to merge 3 commits from export-D45297676 into main
4 changed files with 32 additions and 2 deletions
Showing only changes of commit 10bf9f11fd - Show all commits

View File

@@ -73,6 +73,12 @@ namespace Facebook.Yoga
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern bool YGConfigGetUseLegacyStretchBehaviour(YGConfigHandle config); public static extern bool YGConfigGetUseLegacyStretchBehaviour(YGConfigHandle config);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGConfigSetErrata(YGConfigHandle config, YogaErrata errata);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaErrata YGConfigGetErrata(YGConfigHandle config);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGConfigSetPointScaleFactor( public static extern void YGConfigSetPointScaleFactor(
YGConfigHandle config, YGConfigHandle config,

View File

@@ -117,8 +117,12 @@ namespace Facebook.Yoga
} }
} }
public bool UseLegacyStretchBehaviour [ObsoleteAttribute("\"UseLegacyStretchBehaviour\" will be removed in the next release. " +
{ "Usage should be replaced with \"Errata\" set to \"YogaErrata.All\" to opt out of all " +
"future breaking conformance fixes, or \"YogaErrata.StretchFlexBasis\" toopt out of " +
"the specific conformance fix previously disabled by \"UseLegacyStretchBehaviour\".",
true /*error*/)]
public bool UseLegacyStretchBehaviour {
get get
{ {
return Native.YGConfigGetUseLegacyStretchBehaviour(_ygConfig); return Native.YGConfigGetUseLegacyStretchBehaviour(_ygConfig);
@@ -130,6 +134,19 @@ namespace Facebook.Yoga
} }
} }
public YogaErrata Errata
{
get
{
return Native.YGConfigGetErrata(_ygConfig);
}
set
{
Native.YGConfigSetErrata(_ygConfig, value);
}
}
public float PointScaleFactor public float PointScaleFactor
{ {
set set