fix problems with convex polygons