//--------------------------------------------------------------------
public static void InvertPolygon(VertexStore myvxs, int start)
{
// Skip all non-vertices at the beginning
int vcount = myvxs.Count;
while (start < vcount &&
!VertexHelper.IsVertextCommand(myvxs.GetCommand(start)))
{
++start;
}
// Skip all insignificant move_to
while (start + 1 < vcount &&
VertexHelper.IsMoveTo(myvxs.GetCommand(start)) &&
VertexHelper.IsMoveTo(myvxs.GetCommand(start + 1)))
{
++start;
}
// Find the last vertex
int end = start + 1;
while (end < vcount && !VertexHelper.IsNextPoly(myvxs.GetCommand(end)))
{
++end;
}
InvertPolygon(myvxs, start, end);
}