private void InvertPolygon(uint start, uint end) { uint i; uint tmp_PathAndFlags = m_vertices.Command(start); --end; // Make "end" inclusive // Shift all commands to one position for (i = start; i < end; i++) { m_vertices.ModifyCommand(i, m_vertices.Command(i + 1)); } // Assign starting command to the ending command m_vertices.ModifyCommand(end, tmp_PathAndFlags); // Reverse the polygon while (end > start) { m_vertices.SwapVertices(start++, end--); } }