Exemple #1
0
        public static YogaArray <T> From <T>(YogaArray <T> other)
        {
            var result = new T[other.Length];

            for (var i = 0; i < result.Length; i++)
            {
                result[i] = other[i];
            }
            return(new YogaArray <T>(result));
        }
Exemple #2
0
        public static bool Equal(YogaArray <YogaValue> val1, YogaArray <YogaValue> val2)
        {
            var areEqual = true;

            for (var i = 0; i < val1.Length && areEqual; ++i)
            {
                areEqual = val1[i].Equals(val2[i]);
            }

            return(areEqual);
        }
Exemple #3
0
        public static bool Equal(YogaArray <float?> val1, YogaArray <float?> val2)
        {
            var areEqual = true;

            for (var i = 0; i < val1.Length && areEqual; ++i)
            {
                areEqual = FloatsEqual(val1[i], val2[i]);
            }

            return(areEqual);
        }
Exemple #4
0
        public YogaNode()
        {
            PrintFunction      = null;
            HasNewLayout       = true;
            NodeType           = YogaNodeType.Default;
            _measure           = null;
            Baseline           = null;
            Dirtied            = null;
            _style             = new YogaStyle();
            _layout            = new YogaLayout();
            LineIndex          = 0;
            Owner              = null;
            _children          = new List <YogaNode>();
            NextChild          = null;
            Config             = new YogaConfig();
            _isDirty           = false;
            ResolvedDimensions = new YogaArray <YogaValue>(new YogaValue[] { YogaValue.Undefined, YogaValue.Undefined });
#if DEBUG
            Interlocked.Increment(ref s_dbuginstanceCount);
#endif
        }
Exemple #5
0
        public YogaNode(YogaNode node)
        {
            PrintFunction      = node.PrintFunction;
            HasNewLayout       = node.HasNewLayout;
            NodeType           = node.NodeType;
            _measure           = node._measure;
            Baseline           = node.Baseline;
            Dirtied            = node.Dirtied;
            _style             = node._style;
            _layout            = node._layout;
            LineIndex          = node.LineIndex;
            Owner              = node.Owner;
            _children          = new List <YogaNode>(node._children);
            NextChild          = node.NextChild;
            Config             = node.Config;
            _isDirty           = node._isDirty;
            ResolvedDimensions = YogaArray.From(node.ResolvedDimensions);

#if DEBUG
            Interlocked.Increment(ref s_dbuginstanceCount);
#endif
        }
Exemple #6
0
        public YogaNode(
            YogaPrint print,
            bool hasNewLayout,
            YogaNodeType nodeType,
            YogaMeasure measure,
            YogaBaseline baseline,
            YogaDirtied dirtied,
            YogaStyle style,
            YogaLayout layout,
            int lineIndex,
            YogaNode owner,
            List <YogaNode> children,
            YogaNode nextChild,
            YogaConfig config,
            bool isDirty,
            YogaValue[] resolvedDimensions)
        {
            PrintFunction      = print;
            HasNewLayout       = hasNewLayout;
            NodeType           = nodeType;
            _measure           = measure;
            Baseline           = baseline;
            Dirtied            = dirtied;
            _style             = style;
            _layout            = layout;
            LineIndex          = lineIndex;
            Owner              = owner;
            _children          = new List <YogaNode>(children);
            NextChild          = nextChild;
            Config             = config;
            _isDirty           = isDirty;
            ResolvedDimensions = YogaArray.From(resolvedDimensions);

#if DEBUG
            Interlocked.Increment(ref s_dbuginstanceCount);
#endif
        }