fixed optimizing of polygons with lines on top of each other