/** * Returns the point at which this curve segment intersects the boundary * of the given rectangle, if it does so. If it does not intersect, * null is returned. * * @param curveIndex the curve index specifying the curve to analyse * @param rect the whose boundary is to be tested for intersection * with this curve * @param indexSeg the segments on this curve being checked * @return the point at which this curve segment intersects the boundary * of the given rectangle, if it does so. If it does not intersect, * null is returned. */ protected mxPoint intersectRectPerimeterPoint(String curveIndex, mxRectangle rect, int indexSeg) { mxPoint result = null; mxPoint[] pointsCurve = getCurvePoints(curveIndex); if (pointsCurve != null && pointsCurve.length > 1 && indexSeg >= 0 && indexSeg < pointsCurve.length) { double p1X = pointsCurve[indexSeg - 1].getX(); double p1Y = pointsCurve[indexSeg - 1].getY(); double p2X = pointsCurve[indexSeg].getX(); double p2Y = pointsCurve[indexSeg].getY(); result = rect.intersectLine(p1X, p1Y, p2X, p2Y); } return result; }
/** * Returns the point at which this curve segment intersects the boundary * of the given rectangle, if it does so. If it does not intersect, * null is returned. * * @param curveIndex the curve index specifying the curve to analyse * @param rect the whose boundary is to be tested for intersection * with this curve * @param indexSeg the segments on this curve being checked * @return the point at which this curve segment intersects the boundary * of the given rectangle, if it does so. If it does not intersect, * null is returned. */ protected mxPoint intersectRectPerimeterPoint(String curveIndex, mxRectangle rect, int indexSeg) { mxPoint result = null; mxPoint[] pointsCurve = getCurvePoints(curveIndex); if (pointsCurve != null && pointsCurve.length > 1 && indexSeg >= 0 && indexSeg < pointsCurve.length) { double p1X = pointsCurve[indexSeg - 1].getX(); double p1Y = pointsCurve[indexSeg - 1].getY(); double p2X = pointsCurve[indexSeg].getX(); double p2Y = pointsCurve[indexSeg].getY(); result = rect.intersectLine(p1X, p1Y, p2X, p2Y); } return result; }
if (rect.intersectLine(pointsCurve[i].getX(), pointsCurve[i].getY(), pointsCurve[i - 1].getX(), pointsCurve[i - 1].getY()) != null)
if (rect.intersectLine(pointsCurve[i].getX(), pointsCurve[i].getY(), pointsCurve[i - 1].getX(), pointsCurve[i - 1].getY()) != null)
if (mxRect.intersectLine(pointsCurve[i].getX(), pointsCurve[i].getY(), pointsCurve[i - 1].getX(), pointsCurve[i - 1].getY()) != null)
if (mxRect.intersectLine(pointsCurve[i].getX(), pointsCurve[i].getY(), pointsCurve[i - 1].getX(), pointsCurve[i - 1].getY()) != null)