GetTextBounds() public static method

Get the bounding rectangle for XText shape.
public static GetTextBounds ( XText text, double dx, double dy ) : Rect2
text Core2D.Shapes.XText
dx double
dy double
return Core2D.Math.Rect2
コード例 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="text"></param>
        /// <param name="rect"></param>
        /// <param name="selected"></param>
        /// <param name="dx"></param>
        /// <param name="dy"></param>
        /// <returns></returns>
        public static bool HitTestText(XText text, Rect2 rect, ISet <BaseShape> selected, double dx, double dy)
        {
            if (ShapeBounds.GetTextBounds(text, dx, dy).IntersectsWith(rect))
            {
                if (selected != null)
                {
                    selected.Add(text);
                    return(false);
                }
                else
                {
                    return(true);
                }
            }

            return(false);
        }