Exemple #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);
        }
Exemple #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);
        }
Exemple #3
0
 private bool CanHide(FlexElement flexElement)
 {
     return((flexElement.OverflowBehavior & FlexOverflowBehavior.Hide) != 0);
 }
Exemple #4
0
 private bool CanPin(FlexElement flexElement)
 {
     return((flexElement.OverflowBehavior & FlexOverflowBehavior.Pin) != 0);
 }
Exemple #5
0
 private bool IsArrangeFixed(FlexElement element)
 {
     return(Equals(element.MinLength, element.MaxLength) && Equals(element.MinLength, element.ActualLength));
 }