Return early if dragging, unindent the rest

This commit is contained in:
John Scipione
2014-02-20 15:03:39 -05:00
parent c959ce4612
commit 7e9644053f
@@ -349,8 +349,11 @@ KeyboardLayoutView::MouseMoved(BPoint point, uint32 transit,
return; return;
} }
if (fDragKey == NULL && (fabs(point.x - fClickPoint.x) > 4 if (fDragKey != NULL || !(fabs(point.x - fClickPoint.x) > 4
|| fabs(point.y - fClickPoint.y) > 4)) { || fabs(point.y - fClickPoint.y) > 4)) {
return;
}
// start dragging // start dragging
Key* key = _KeyAt(fClickPoint); Key* key = _KeyAt(fClickPoint);
if (key == NULL) if (key == NULL)
@@ -399,7 +402,6 @@ KeyboardLayoutView::MouseMoved(BPoint point, uint32 transit,
fKeyState[key->code / 8] &= ~(1 << (7 - (key->code & 7))); fKeyState[key->code / 8] &= ~(1 << (7 - (key->code & 7)));
_InvalidateKey(key); _InvalidateKey(key);
} }
}
void void