From 3bd2b7762a5960cf98fcd2cd889df0e5ca3ed13a Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Thu, 20 Jun 2019 06:46:41 -0700 Subject: [PATCH] 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 f25ae373bb75bdc3dcd2210ab8074a8f022cba79) --- pcbnew/dialogs/dialog_move_exact.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pcbnew/dialogs/dialog_move_exact.cpp b/pcbnew/dialogs/dialog_move_exact.cpp index 08bbc48ca3..e92499dae8 100644 --- a/pcbnew/dialogs/dialog_move_exact.cpp +++ b/pcbnew/dialogs/dialog_move_exact.cpp @@ -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::max() * 0.7071; + double delta_x = m_moveX.GetValue(); + double delta_y = m_moveY.GetValue(); + double max_border = std::numeric_limits::max() * 0.7071; if( m_bbox.GetLeft() + delta_x < -max_border || m_bbox.GetRight() + delta_x > max_border ||