Polygon: merging fix of bug #8197 with release branch.