src/main/java/com/mxgraph/util/mxCurve.java
public boolean intersectsRect(Rectangle rect)
	{
		// To save CPU, we can test if the rectangle intersects the entire
		// bounds of this curve
		if (!getBounds().getRectangle().intersects(rect))
		{
			return false;
		}

		mxPoint[] pointsCurve = getCurvePoints(mxCurve.CORE_CURVE);

		if (pointsCurve != null && pointsCurve.length > 1)
		{
			mxRectangle mxRect = new mxRectangle(rect);
			// First check for any of the curve points lying within the 
			// rectangle, then for any of the curve segments intersecting 
			// with the rectangle sides
			for (int i = 1; i < pointsCurve.length; i++)
			{
				if (mxRect.contains(pointsCurve[i].getX(),
						pointsCurve[i].getY())
						|| mxRect.contains(pointsCurve[i - 1].getX(),
								pointsCurve[i - 1].getY()))
				{
					return true;
				}
			}

			for (int i = 1; i < pointsCurve.length; i++)
			{
				if (mxRect.intersectLine(pointsCurve[i].getX(),
						pointsCurve[i].getY(), pointsCurve[i - 1].getX(),
						pointsCurve[i - 1].getY()) != null)
				{
					return true;
				}
			}
		}

		return false;
	}
/**
	 * Returns whether or not the rectangle passed in hits any part of this
	 * curve.
	 * @param rect the rectangle to detect for a hit
	 * @return whether or not the rectangle hits this curve
	 */
Returns whether or not the rectangle passed in hits any part of this
curve.
@param rect the rectangle to detect for a hit
@return whether or not the rectangle hits this curve
Returns whether or not the rectangle passed in hits any part of this curve . @param rect the rectangle to detect for a hit @return whether or not the rectangle hits this curve
public boolean intersectsRect(Rectangle rect)
	{
		if (!getBounds().getRectangle().intersects(rect))
		{
			return false;
		}
		mxPoint[] pointsCurve = getCurvePoints(mxCurve.CORE_CURVE);
		if (pointsCurve != null && pointsCurve.length > 1)
		{
			mxRectangle mxRect = new mxRectangle(rect);
			for (int i = 1; i < pointsCurve.length; i++)
			{
				if (mxRect.contains(pointsCurve[i].getX(),
						pointsCurve[i].getY())
						|| mxRect.contains(pointsCurve[i - 1].getX(),
								pointsCurve[i - 1].getY()))
				{
					return true;
				}
			}
			for (int i = 1; i < pointsCurve.length; i++)
			{
				if (mxRect.intersectLine(pointsCurve[i].getX(),
						pointsCurve[i].getY(), pointsCurve[i - 1].getX(),
						pointsCurve[i - 1].getY()) != null)
				{
					return true;
				}
			}
		}
		return false;
	}
public boolean intersectsRect ( Rectangle rect ) { if ( ! getBounds ( ) . getRectangle ( ) . intersects ( rect ) ) { return false ; } mxPoint [ ] pointsCurve = getCurvePoints ( mxCurve . CORE_CURVE ) ; if ( pointsCurve != null && pointsCurve . length > 1 ) { mxRectangle mxRect = new mxRectangle ( rect ) ; for ( int i = 1 ; i < pointsCurve . length ; i ++ ) { if ( mxRect . contains ( pointsCurve [ i ] . getX ( ) , pointsCurve [ i ] . getY ( ) ) || mxRect . contains ( pointsCurve [ i - 1 ] . getX ( ) , pointsCurve [ i - 1 ] . getY ( ) ) ) { return true ; } } for ( int i = 1 ; i < pointsCurve . length ; i ++ ) { if ( mxRect . intersectLine ( pointsCurve [ i ] . getX ( ) , pointsCurve [ i ] . getY ( ) , pointsCurve [ i - 1 ] . getX ( ) , pointsCurve [ i - 1 ] . getY ( ) ) != null ) { return true ; } } } return false ; }
Returns whether or not the rectangle passed in hits any part of this
 curve.
Returns whether or not the rectangle passed in hits any part of this curve .
// To save CPU, we can test if the rectangle intersects the entire // bounds of this curve // First check for any of the curve points lying within the  // rectangle, then for any of the curve segments intersecting  // with the rectangle sides