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.
This commit is contained in:
parent
845833e8fd
commit
f25ae373bb
|
@ -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 ||
|
||||
|
|
Loading…
Reference in New Issue