I was coding a simple shape-collision-detector, but I noticed the rectangle which I move using the mouse vanishes in some window's areas. I can't figure out why.
Here you can see the video and below the code I used. Any advice?
Rectangle r = new Rectangle();
r.setWidth(150);
r.setHeight(150);
Group root = new Group(r, e, boh);
Scene scene = new Scene(root, 1000, 1000);
scene.setOnMouseDragged(ev -> {
r.setX(ev.getX() - r.getWidth() / 2);
r.setY(ev.getY() - r.getHeight() / 2);
});