Esempio n. 1
0
        public float GetTrailingBorder(YogaFlexDirection flexDirection)
        {
            if (flexDirection.IsRow() &&
                _style.Border[YogaEdge.End].Unit != YogaUnit.Undefined &&
                _style.Border[YogaEdge.End].Value != null &&
                _style.Border[YogaEdge.End].Value >= 0.0f)
            {
                return(_style.Border[YogaEdge.End].Value.Value);
            }

            var computedEdgeValue = ComputedEdgeValue(_style.Border, Trailing[flexDirection], YogaValue.Zero).Value;

            return(YogaMath.Max(computedEdgeValue, 0.0f));
        }
Esempio n. 2
0
        public float GetLeadingBorder(YogaFlexDirection axis)
        {
            if (axis.IsRow() &&
                _style.Border[YogaEdge.Start].Unit != YogaUnit.Undefined &&
                _style.Border[YogaEdge.Start].Value != null &&
                _style.Border[YogaEdge.Start].Value >= 0.0f)
            {
                return(_style.Border[YogaEdge.Start].Value.Value);
            }

            var computedEdgeValue = ComputedEdgeValue(_style.Border, Leading[axis], YogaValue.Zero).Value;

            return(YogaMath.Max(computedEdgeValue, 0.0F));
        }
Esempio n. 3
0
        public float GetTrailingPadding(YogaFlexDirection axis, float?widthSize)
        {
            var paddingEdgeEnd = _style.Padding[YogaEdge.End].Resolve(widthSize);

            if (axis.IsRow() &&
                _style.Padding[YogaEdge.End].Unit != YogaUnit.Undefined &&
                paddingEdgeEnd != null &&
                paddingEdgeEnd >= 0.0f)
            {
                return(paddingEdgeEnd.Value);
            }

            var resolvedValue = ComputedEdgeValue(_style.Padding, Trailing[axis], YogaValue.Zero).Resolve(widthSize);

            return(YogaMath.Max(resolvedValue, 0.0f));
        }