public TextureGrid<FloatRectangle> ToDisplayRegionGrid(float gridSpacing)
{
TextureGrid<FloatRectangle> toReturn = new TextureGrid<FloatRectangle>();
toReturn.FirstPaintedX = FirstPaintedX;
toReturn.LastPaintedX = new List<float>();
toReturn.FirstPaintedY = FirstPaintedY;
toReturn.LastPaintedY = toReturn.FirstPaintedY + (ReferenceGrid.Length - 1) * gridSpacing;
toReturn.GridSpacingX = gridSpacing;
toReturn.GridSpacingY = gridSpacing;
int yOn = 0;
//toReturn.BaseTexture = new FloatRectangle(0,1,0,1);
foreach (FloatRectangle[] frArray in ReferenceGrid)
{
List<FloatRectangle> newFloatRectangleList =
new List<FloatRectangle>();
toReturn.Textures.Add(newFloatRectangleList);
toReturn.LastPaintedX.Add(toReturn.FirstPaintedX[yOn] + gridSpacing * (frArray.Length - 1));
foreach (FloatRectangle rectangle in frArray)
{
newFloatRectangleList.Add(rectangle);
}
yOn++;
}
return toReturn;
}