Issue #161: moved polygon rendering code into Polygon class