Fix polygon to take into account the y coordinate

Previously, the x center was used for both y and x coordinate calculations. I changed polygon to use center_y for the y coord calculations instead of center_x which fixes the problem.