Overlap() public static méthode

public static Overlap ( Vector2 selection, IList points, double dx, double dy ) : bool
selection Vector2
points IList
dx double
dy double
Résultat bool
Exemple #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="quadraticBezier"></param>
        /// <param name="selection"></param>
        /// <param name="selected"></param>
        /// <param name="dx"></param>
        /// <param name="dy"></param>
        /// <returns></returns>
        public static bool HitTestQadraticBezier(XQuadraticBezier quadraticBezier, Vector2[] selection, ISet <BaseShape> selected, double dx, double dy)
        {
            var points = quadraticBezier.GetPoints().ToImmutableArray();

            if (ShapeBounds.Overlap(selection, points, dx, dy))
            {
                if (selected != null)
                {
                    selected.Add(quadraticBezier);
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            return(false);
        }
Exemple #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="path"></param>
        /// <param name="selection"></param>
        /// <param name="selected"></param>
        /// <param name="dx"></param>
        /// <param name="dy"></param>
        /// <returns></returns>
        public static bool HitTestPath(XPath path, Vector2[] selection, ISet <BaseShape> selected, double dx, double dy)
        {
            if (path.Geometry != null)
            {
                var points = path.GetPoints().ToImmutableArray();
                if (ShapeBounds.Overlap(selection, points, dx, dy))
                {
                    if (selected != null)
                    {
                        selected.Add(path);
                        return(false);
                    }
                    else
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }