Reputation: 5
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!!
Upvotes: 0
Views: 289
Reputation: 324177
Use:
Shape strokedShape = basicStroke.createStrokedShape(Shape s)
Then you can do the intersection using the strokedShape
.
Upvotes: 2