Пример #1
0
 // Token: 0x06000E9D RID: 3741 RVA: 0x000381F0 File Offset: 0x000363F0
 private Thickness CoerceThumbnailClipMargin(Thickness margin)
 {
     if (!margin.IsValid(false, false, false, false))
     {
         return(default(Thickness));
     }
     return(margin);
 }
Пример #2
0
        private Thickness CoerceThumbnailClipMargin(Thickness margin)
        {
            // Any negative/NaN/Infinity margins we'll treat as nil.
            if (!margin.IsValid(false, false, false, false))
            {
                return(new Thickness());
            }

            return(margin);
        }
        /// <summary>
        /// Converts the Thickness object to Vector4. If the Thickness
        /// object contains negative components they will be converted
        /// to positive values. If the Thickness object's component
        /// have values NaN, PositiveInfinity or NegativeInfinity,
        /// then Vector4.Zero will be returned.
        /// </summary>
        /// <param name="thickness">Thickness object</param>
        /// <returns></returns>
        public static Vector4 ToAbsVector4(this Thickness thickness)
        {
            if (thickness.IsValid(true, false, false, false))
            {
                // Sanitize the component by taking only
                return(new Vector4(Math.Abs(thickness.Left).ToSingle(),
                                   Math.Abs(thickness.Top).ToSingle(),
                                   Math.Abs(thickness.Right).ToSingle(),
                                   Math.Abs(thickness.Bottom).ToSingle()));
            }

            return(Vector4.Zero);
        }
Пример #4
0
        /// <summary>
        /// Converts the Thickness object to Vector4. If the Thickness object's component have values NaN, PositiveInfinity or NegativeInfinity, then Vector4.Zero will be returned.
        /// </summary>
        /// <param name="thickness">Thickness object</param>
        /// <returns>Vector4</returns>
        public static Vector4 ToVector4(this Thickness thickness)
        {
            if (thickness.IsValid(true, false, false, false))
            {
                // Sanitize the component by taking only
                return(new Vector4(
                           (float)thickness.Left,
                           (float)thickness.Top,
                           (float)thickness.Right,
                           (float)thickness.Bottom));
            }

            return(Vector4.Zero);
        }
Пример #5
0
        private static bool IsThicknessValid(object value)
        {
            Thickness t = (Thickness)value;

            return(t.IsValid(false, false, false, false));
        }