Don't crash when we have bad data (should fix it at a higher level (rebuild from children))

This commit is contained in:
Lars Brubaker 2018-05-09 09:29:54 -07:00
parent 9678fe7561
commit a360cc1112
3 changed files with 15 additions and 6 deletions

View file

@ -361,8 +361,11 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
{
if (XAlign == Align.None)
{
// make sure it is where it started
AlignAxis(0, Align.Min, OriginalChildrenBounds[i].minXYZ.X, 0, child);
if (i < OriginalChildrenBounds.Count)
{
// make sure it is where it started
AlignAxis(0, Align.Min, OriginalChildrenBounds[i].minXYZ.X, 0, child);
}
}
else
{
@ -380,7 +383,10 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
}
if (YAlign == Align.None)
{
AlignAxis(1, Align.Min, OriginalChildrenBounds[i].minXYZ.Y, 0, child);
if (i < OriginalChildrenBounds.Count)
{
AlignAxis(1, Align.Min, OriginalChildrenBounds[i].minXYZ.Y, 0, child);
}
}
else
{
@ -398,7 +404,10 @@ namespace MatterHackers.MatterControl.DesignTools.Operations
}
if (ZAlign == Align.None)
{
AlignAxis(2, Align.Min, OriginalChildrenBounds[i].minXYZ.Z, 0, child);
if (i < OriginalChildrenBounds.Count)
{
AlignAxis(2, Align.Min, OriginalChildrenBounds[i].minXYZ.Z, 0, child);
}
}
else
{

@ -1 +1 @@
Subproject commit 1cec8e732bb95f09fdad483470f8afa84de670e8
Subproject commit 43bee860f8887ca6c6d64116fb3ed3b3edb61f3c

@ -1 +1 @@
Subproject commit 1ec9397907ccc1a191421c10278ceec0d99b7687
Subproject commit eaeaa76c2bf42789a494e6a58a54a434f2cc4c27