Пример #1
0
 // StyleSetMaxHeightPercent sets max height percent
 public void StyleSetMaxHeightPercent(float maxHeight)
 {
     if (this.nodeStyle.MaxDimensions[(int)Dimension.Height].value != maxHeight ||
         this.nodeStyle.MaxDimensions[(int)Dimension.Height].unit != Unit.Percent)
     {
         this.nodeStyle.MaxDimensions[(int)Dimension.Height].value = maxHeight;
         this.nodeStyle.MaxDimensions[(int)Dimension.Height].unit  = Unit.Percent;
         if (Flex.FloatIsUndefined(maxHeight))
         {
             this.nodeStyle.MaxDimensions[(int)Dimension.Height].unit = Unit.Auto;
         }
         Flex.nodeMarkDirtyInternal(this);
     }
 }
Пример #2
0
 // StyleSetBorder sets border
 public void StyleSetBorder(Edge edge, float border)
 {
     if (this.nodeStyle.Border[(int)edge].value != border ||
         this.nodeStyle.Border[(int)edge].unit != Unit.Point)
     {
         this.nodeStyle.Border[(int)edge].value = border;
         this.nodeStyle.Border[(int)edge].unit  = Unit.Point;
         if (Flex.FloatIsUndefined(border))
         {
             this.nodeStyle.Border[(int)edge].unit = Unit.Undefined;
         }
         Flex.nodeMarkDirtyInternal(this);
     }
 }
Пример #3
0
 // StyleSetMaxWidth sets max width
 public void StyleSetMaxWidth(float maxWidth)
 {
     if (this.nodeStyle.MaxDimensions[(int)Dimension.Width].value != maxWidth ||
         this.nodeStyle.MaxDimensions[(int)Dimension.Width].unit != Unit.Point)
     {
         this.nodeStyle.MaxDimensions[(int)Dimension.Width].value = maxWidth;
         this.nodeStyle.MaxDimensions[(int)Dimension.Width].unit  = Unit.Point;
         if (Flex.FloatIsUndefined(maxWidth))
         {
             this.nodeStyle.MaxDimensions[(int)Dimension.Width].unit = Unit.Auto;
         }
         Flex.nodeMarkDirtyInternal(this);
     }
 }
Пример #4
0
 // StyleSetPaddingPercent sets padding percent
 public void StyleSetPaddingPercent(Edge edge, float padding)
 {
     if (this.nodeStyle.Padding[(int)edge].value != padding ||
         this.nodeStyle.Padding[(int)edge].unit != Unit.Percent)
     {
         this.nodeStyle.Padding[(int)edge].value = padding;
         this.nodeStyle.Padding[(int)edge].unit  = Unit.Percent;
         if (Flex.FloatIsUndefined(padding))
         {
             this.nodeStyle.Padding[(int)edge].unit = Unit.Undefined;
         }
         Flex.nodeMarkDirtyInternal(this);
     }
 }
Пример #5
0
 // StyleSetMarginPercent sets margin percent
 public void StyleSetMarginPercent(Edge edge, float margin)
 {
     if (this.nodeStyle.Margin[(int)edge].value != margin ||
         this.nodeStyle.Margin[(int)edge].unit != Unit.Percent)
     {
         this.nodeStyle.Margin[(int)edge].value = margin;
         this.nodeStyle.Margin[(int)edge].unit  = Unit.Percent;
         if (Flex.FloatIsUndefined(margin))
         {
             this.nodeStyle.Margin[(int)edge].unit = Unit.Undefined;
         }
         Flex.nodeMarkDirtyInternal(this);
     }
 }
Пример #6
0
 // StyleSetFlexBasisPercent sets flex basis percent
 public void StyleSetFlexBasisPercent(float flexBasis)
 {
     if (this.nodeStyle.FlexBasis.value != flexBasis ||
         this.nodeStyle.FlexBasis.unit != Unit.Percent)
     {
         this.nodeStyle.FlexBasis.value = flexBasis;
         this.nodeStyle.FlexBasis.unit  = Unit.Percent;
         if (Flex.FloatIsUndefined(flexBasis))
         {
             this.nodeStyle.FlexBasis.unit = Unit.Auto;
         }
         Flex.nodeMarkDirtyInternal(this);
     }
 }
Пример #7
0
        // StyleSetHeightPercent sets height percent
        public void StyleSetHeightPercent(float height)
        {
            var dim = this.nodeStyle.Dimensions[(int)Dimension.Height];

            if (dim.value != height || dim.unit != Unit.Percent)
            {
                dim.value = height;
                dim.unit  = Unit.Percent;
                if (Flex.FloatIsUndefined(height))
                {
                    dim.unit = Unit.Auto;
                }
                Flex.nodeMarkDirtyInternal(this);
            }
        }
Пример #8
0
        // StyleSetWidthPercent sets width percent
        public void StyleSetWidthPercent(float width)
        {
            var dim = this.nodeStyle.Dimensions[(int)Dimension.Width];

            if (dim.value != width || dim.unit != Unit.Percent)
            {
                dim.value = width;
                dim.unit  = Unit.Percent;
                if (Flex.FloatIsUndefined(width))
                {
                    dim.unit = Unit.Auto;
                }
                Flex.nodeMarkDirtyInternal(this);
            }
        }
Пример #9
0
        // StyleSetPositionPercent sets position percent
        public void StyleSetPositionPercent(Edge edge, float position)
        {
            var pos = this.nodeStyle.Position[(int)edge];

            if (pos.value != position || pos.unit != Unit.Percent)
            {
                pos.value = position;
                pos.unit  = Unit.Percent;
                if (Flex.FloatIsUndefined(position))
                {
                    pos.unit = Unit.Undefined;
                }
                Flex.nodeMarkDirtyInternal(this);
            }
        }