Beispiel #1
0
        internal static Point RestrictRange(Rect rect, Point p)
        {
            var x = ConnectorUtilities.RestrictRange(rect.Left, rect.Right, p.X);
            var y = ConnectorUtilities.RestrictRange(rect.Top, rect.Bottom, p.Y);

            return(new Point(x, y));
        }
Beispiel #2
0
        internal static Point RestrictRange(Rect rect, Point p,
                                            double marginX, double marginY)
        {
            var x = ConnectorUtilities.RestrictRange(rect.Left + marginX, rect.Right - marginX, p.X);
            var y = ConnectorUtilities.RestrictRange(rect.Top - marginY, rect.Bottom + marginY, p.Y);

            return(new Point(x, y));
        }