Catch overflow exception handling bounding box

This commit is contained in:
baldurk
2015-07-24 00:16:45 +02:00
parent 7c6790d1d7
commit 2967a8a5ce
+8 -1
View File
@@ -2445,7 +2445,14 @@ namespace renderdocui.Windows
ui.m_MinBounds[CurPosElement].z + diag.z / 2.0f);
m_Arcball.SetDistance(diag.Length()*0.7f);
camSpeed.Value = Helpers.Clamp((decimal)(diag.Length() / 200.0f), camSpeed.Minimum, camSpeed.Maximum);
try
{
camSpeed.Value = Helpers.Clamp((decimal)(diag.Length() / 200.0f), camSpeed.Minimum, camSpeed.Maximum);
}
catch (OverflowException)
{
camSpeed.Value = (decimal)1.0f;
}
render.Invalidate();
}