Add C# bindings for Errata API #1259
@@ -175,6 +175,7 @@ static YGConfigRef globalConfig;
|
|||||||
globalConfig = YGConfigNew();
|
globalConfig = YGConfigNew();
|
||||||
YGConfigSetExperimentalFeatureEnabled(
|
YGConfigSetExperimentalFeatureEnabled(
|
||||||
globalConfig, YGExperimentalFeatureWebFlexBasis, true);
|
globalConfig, YGExperimentalFeatureWebFlexBasis, true);
|
||||||
|
YGConfigSetErrata(globalConfig, YGErrataClassic);
|
||||||
YGConfigSetPointScaleFactor(globalConfig, [UIScreen mainScreen].scale);
|
YGConfigSetPointScaleFactor(globalConfig, [UIScreen mainScreen].scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -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,
|
||||||
|
@@ -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
|
||||||
|
@@ -22,7 +22,13 @@ public abstract class YogaConfig {
|
|||||||
* Yoga previously had an error where containers would take the maximum space possible instead of the minimum
|
* Yoga previously had an error where containers would take the maximum space possible instead of the minimum
|
||||||
* like they are supposed to. In practice this resulted in implicit behaviour similar to align-self: stretch;
|
* like they are supposed to. In practice this resulted in implicit behaviour similar to align-self: stretch;
|
||||||
* Because this was such a long-standing bug we must allow legacy users to switch back to this behaviour.
|
* Because this was such a long-standing bug we must allow legacy users to switch back to this behaviour.
|
||||||
|
*
|
||||||
|
* @deprecated "setUseLegacyStretchBehaviour" will be removed in the next release. Usage should be replaced with
|
||||||
|
* "setErrata(YogaErrata.ALL)" to opt out of all future breaking conformance fixes, or
|
||||||
|
* "setErrata(YogaErrata.STRETCH_FLEX_BASIS)" to opt out of the specific conformance fix previously disabled by
|
||||||
|
* "UseLegacyStretchBehaviour".
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public abstract void setUseLegacyStretchBehaviour(boolean useLegacyStretchBehaviour);
|
public abstract void setUseLegacyStretchBehaviour(boolean useLegacyStretchBehaviour);
|
||||||
|
|
||||||
public abstract void setErrata(YogaErrata errata);
|
public abstract void setErrata(YogaErrata errata);
|
||||||
|
Reference in New Issue
Block a user