Change Rectangle class to internally store a Polygon instance instead of canvas rectangle.