Fix the center point issue, change Rectangle to Rectangle2D since
Rectangle is a subclass of that.