feat: adjust wheelEvent speed

This commit is contained in:
rankun 2020-03-12 18:57:16 +08:00
parent 3f07c3379e
commit 9efc448089

View file

@ -1,3 +1,5 @@
#include <cmath>
#include "inputconvertnormal.h"
InputConvertNormal::InputConvertNormal(Controller* controller)
@ -63,10 +65,10 @@ void InputConvertNormal::wheelEvent(const QWheelEvent *from, const QSize& frameS
qint32 vScroll = 0;
switch (from->orientation()) {
case Qt::Horizontal:
hScroll = from->delta();
hScroll = from->delta() / abs(from->delta()) * 2;
break;
case Qt::Vertical:
vScroll = from->delta();
vScroll = from->delta() / abs(from->delta()) * 2;
break;
}