In the code I have written, I am trying to determine when two Rectangle2D shapes have intersected. However when I run the code, the intersect method always returns true even when the shapes are clearly not. If anyone has any insight into this issue I would greatly appreciate it.
Graphics2D g2 = (Graphics2D) getGraphics();
FontRenderContext context = g2.getFontRenderContext();
Rectangle2D rectangleOne = fontOne.getStringBounds(blockOne, context);
Rectangle2D rectangleTwo= fontTwo.getStringBounds(blockTwo, context);
if(rectangleOne.intersects(rectangleTwo)){ ...