Work around possible IndexOutOfRangeException in NewLocation code.

This commit is contained in:
wo80
2022-02-13 14:26:23 +01:00
parent 0fb43a4626
commit 1dbac98d67
+6
View File
@@ -2290,6 +2290,12 @@ namespace TriangleNet
// now the second point is the neighbor's third vertex
second_x = returnPoint[0];
second_y = returnPoint[1];
if (numvertices == points.Length)
{
Array.Resize(ref points, numvertices * 2);
}
// add a new point to the list of surrounding points
points[numvertices] = returnPoint[0];
numvertices++;