Allow to reset measure and baseline functions
Summary: Once measure and baseline functions are set, C# layer never calls YGNodeSetMeasure/BaselineFunc with NULL. This diff will fix the issue. Closes https://github.com/facebook/yoga/pull/468 Reviewed By: emilsjolander Differential Revision: D4676753 Pulled By: splhack fbshipit-source-id: da34de2fc28adf320a18de2addffe9671cf1ecf9
This commit is contained in:
committed by
Facebook Github Bot
parent
406c8a2117
commit
a8e6123d47
@@ -64,8 +64,8 @@ namespace Facebook.Yoga
|
||||
private BaselineFunction _baselineFunction;
|
||||
private object _data;
|
||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
||||
private static YogaMeasureFunc _managedMeasure = MeasureInternalIOS;
|
||||
private static YogaBaselineFunc _managedBaseline = BaselineInternalIOS;
|
||||
private static YogaMeasureFunc _managedMeasure;
|
||||
private static YogaBaselineFunc _managedBaseline;
|
||||
#else
|
||||
private YogaMeasureFunc _managedMeasure;
|
||||
private YogaBaselineFunc _managedBaseline;
|
||||
@@ -617,11 +617,16 @@ namespace Facebook.Yoga
|
||||
if (measureFunction != null)
|
||||
{
|
||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
||||
_managedMeasure = MeasureInternalIOS;
|
||||
_ygNode.SetContext(this);
|
||||
#else
|
||||
_managedMeasure = MeasureInternal;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
_managedMeasure = null;
|
||||
}
|
||||
Native.YGNodeSetMeasureFunc(_ygNode, _managedMeasure);
|
||||
}
|
||||
|
||||
@@ -631,11 +636,16 @@ namespace Facebook.Yoga
|
||||
if (baselineFunction != null)
|
||||
{
|
||||
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
|
||||
_managedBaseline = BaselineInternalIOS;
|
||||
_ygNode.SetContext(this);
|
||||
#else
|
||||
_managedBaseline = BaselineInternal;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
_managedBaseline = null;
|
||||
}
|
||||
Native.YGNodeSetBaselineFunc(_ygNode, _managedBaseline);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user