Exemple #1
0
        public void copy_style_same()
        {
            YogaNode node0 = Node();
            YogaNode node1 = Node();

            Assert.IsFalse(node0.IsDirty);

            node0.CopyStyle(node1);
            Assert.IsFalse(node0.IsDirty);
        }
Exemple #2
0
        public void TestCopyStyle()
        {
            YogaNode node0 = new YogaNode();

            Assert.IsTrue(YogaConstants.IsUndefined(node0.MaxHeight));

            YogaNode node1 = new YogaNode();

            node1.MaxHeight = 100;

            node0.CopyStyle(node1);
            Assert.AreEqual(100, node0.MaxHeight);
        }
Exemple #3
0
        public void copy_style_modified_same()
        {
            YogaNode node0 = Node(flexDirection: FlexDirection.Row, maxHeight: 10);

            YogaArrange.CalculateLayout(node0, YogaValue.YGUndefined, YogaValue.YGUndefined, Direction.LTR);

            Assert.IsFalse(node0.IsDirty);

            YogaNode node1 = Node(flexDirection: FlexDirection.Row, maxHeight: 10);

            node0.CopyStyle(node1);
            Assert.IsFalse(node0.IsDirty);
        }
Exemple #4
0
        public void copy_style_modified()
        {
            YogaNode node0 = Node();

            Assert.IsFalse(node0.IsDirty);
            Assert.AreEqual(FlexDirection.Column, node0.Style.FlexDirection);
            Assert.IsFalse(node0.Style.MaxHeight.Unit != YogaUnit.Undefined);

            YogaNode node1 = Node();

            node1.Style.FlexDirection = FlexDirection.Row;
            node1.Style.MaxHeight     = 10;

            node0.CopyStyle(node1);
            Assert.IsTrue(node0.IsDirty);
            Assert.AreEqual(FlexDirection.Row, node0.Style.FlexDirection);
            Assert.AreEqual(10, node0.Style.MaxHeight.Value);
        }