Beispiel #1
0
        public void Reset()
        {
            _measureFunction  = null;
            _baselineFunction = null;
            _data             = null;

            _ygNode.ReleaseManaged();
            Native.YGNodeReset(_ygNode);
            _ygNode.SetContext(this);
        }
Beispiel #2
0
        public YogaNode(YogaConfig config = null)
        {
            _config = config == null ? YogaConfig.Default : config;
            _ygNode = Native.YGNodeNewWithConfig(_config.Handle);
            if (_ygNode.IsInvalid)
            {
                throw new InvalidOperationException("Failed to allocate native memory");
            }

            _ygNode.SetContext(this);
        }