0
votes

In Java We can find whether a line2D intersects a given rectangle2D using the intersects() method, but that is assuming the line is 1 pixel wide. If I draw my line after setting the basicstroke to thicker than 1 pixel how can I find if that thick line intersects the rectangle or not?? Same question applies to Quadcurve2D!!

1

1 Answers

2
votes

Use:

Shape strokedShape = basicStroke.createStrokedShape(Shape s)

Then you can do the intersection using the strokedShape.