Ejemplo n.º 1
0
        private static bool DistributeRoundingError(ref double roundingError, ref FlexElement flexElement)
        {
            if (roundingError > 0)
            {
                if (flexElement.ActualLength - 1 >= flexElement.ActualMinLength == false)
                {
                    return(false);
                }

                flexElement.ActualLength -= 1;
                roundingError--;

                return(true);
            }

            if (roundingError < 0)
            {
                if (flexElement.ActualLength + 1 <= flexElement.ActualMaxLength == false)
                {
                    return(false);
                }

                flexElement.ActualLength += 1;
                roundingError++;

                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        private static OrientedSize GetChildConstraint(FlexElement flexElement, OrientedSize autoConstraint, OrientedSize starConstraint)
        {
            var flexLength = flexElement.Length;

            if (flexLength.IsStar)
            {
                starConstraint.Direct *= flexLength.Value;

                return(starConstraint);
            }

            if (flexLength.IsAbsolute)
            {
                autoConstraint.Direct = flexLength.Value;

                return(autoConstraint);
            }

            return(autoConstraint);
        }
Ejemplo n.º 3
0
 private bool CanHide(FlexElement flexElement)
 {
     return((flexElement.OverflowBehavior & FlexOverflowBehavior.Hide) != 0);
 }
Ejemplo n.º 4
0
 private bool CanPin(FlexElement flexElement)
 {
     return((flexElement.OverflowBehavior & FlexOverflowBehavior.Pin) != 0);
 }
Ejemplo n.º 5
0
 private bool IsArrangeFixed(FlexElement element)
 {
     return(Equals(element.MinLength, element.MaxLength) && Equals(element.MinLength, element.ActualLength));
 }