Fixup previous move commit

The previous commit missed a case where the number was so large that it
overflowed the integer invalidating the comparison.  This protects
against that case by using floating point comparison.

(cherry picked from commit f25ae373bb)
This commit is contained in:
Seth Hillbrand
2019-06-20 06:48:10 -07:00
parent 4a18f9db3a
commit 3bd2b7762a
+3 -3
View File
@@ -245,9 +245,9 @@ void DIALOG_MOVE_EXACT::OnTextFocusLost( wxFocusEvent& event )
void DIALOG_MOVE_EXACT::OnTextChanged( wxCommandEvent& event )
{
int delta_x = m_moveX.GetValue();
int delta_y = m_moveY.GetValue();
int max_border = std::numeric_limits<int>::max() * 0.7071;
double delta_x = m_moveX.GetValue();
double delta_y = m_moveY.GetValue();
double max_border = std::numeric_limits<int>::max() * 0.7071;
if( m_bbox.GetLeft() + delta_x < -max_border ||
m_bbox.GetRight() + delta_x > max_border ||