private static float BaselineInternal( IntPtr unmanagedNodePtr, float width, float height) { var node = YGNodeHandle.GetManaged(unmanagedNodePtr); if (node == null || node._baselineFunction == null) { throw new InvalidOperationException("Baseline function is not defined."); } return(node._baselineFunction(node, width, height)); }
private static YogaSize MeasureInternal( IntPtr unmanagedNodePtr, float width, YogaMeasureMode widthMode, float height, YogaMeasureMode heightMode) { var node = YGNodeHandle.GetManaged(unmanagedNodePtr); if (node == null || node._measureFunction == null) { throw new InvalidOperationException("Measure function is not defined."); } return(node._measureFunction(node, width, widthMode, height, heightMode)); }
private static void LoggerInternal( IntPtr unmanagedConfigPtr, IntPtr unmanagedNodePtr, YogaLogLevel level, string message) { var config = YGConfigHandle.GetManaged(unmanagedConfigPtr); if (config == null || config._logger == null) { // Default logger System.Diagnostics.Debug.WriteLine(message); } else { var node = YGNodeHandle.GetManaged(unmanagedNodePtr); config._logger(config, node, level, message); } if (level == YogaLogLevel.Error || level == YogaLogLevel.Fatal) { throw new InvalidOperationException(message); } }