Slight cleanup of mousewheel pr

Fixes theoretical uninitialized variable and micro-optimizes scrollwheel stop code
This commit is contained in:
MSuih 2020-01-03 22:07:40 +02:00 committed by Megamouse
parent 69f11d82d1
commit 049f852a9c
2 changed files with 13 additions and 12 deletions

View file

@ -730,8 +730,9 @@ void pad_settings_dialog::wheelEvent(QWheelEvent *event)
key = mouse::wheel_right;
}
}
if (const int y = direction.y())
else
{
const int y = direction.y();
bool to_up = event->inverted() ? y < 0 : y > 0;
if (to_up)
{