summaryrefslogtreecommitdiff
path: root/muse2/muse/waveedit
diff options
context:
space:
mode:
authorRobert Jonsson <spamatica@gmail.com>2011-08-27 18:30:50 +0000
committerRobert Jonsson <spamatica@gmail.com>2011-08-27 18:30:50 +0000
commited5aec7376ab2f4c68750c07ca4187d8b17c349d (patch)
treeeb494cbfdbeb78071c127147842fbf454488a0bc /muse2/muse/waveedit
parent390582dfac9951fdf1be5708763ebad4d52e3526 (diff)
mouse wheel behaviour changed
Diffstat (limited to 'muse2/muse/waveedit')
-rw-r--r--muse2/muse/waveedit/waveview.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/muse2/muse/waveedit/waveview.cpp b/muse2/muse/waveedit/waveview.cpp
index cd798c40..236e2588 100644
--- a/muse2/muse/waveedit/waveview.cpp
+++ b/muse2/muse/waveedit/waveview.cpp
@@ -396,35 +396,35 @@ void WaveView::wheelEvent(QWheelEvent* ev)
bool ctrl = keyState & Qt::ControlModifier;
if (shift) { // scroll vertically
- emit mouseWheelMoved(ev->delta() / 10);
+ int delta = -ev->delta() / WHEEL_DELTA;
+ int xpixelscale = 5*fast_log10(rmapxDev(1));
- } else if (ctrl) { // zoom horizontally
- if (ev->delta()>0)
- emit horizontalZoomIn();
- else
- emit horizontalZoomOut();
- } else { // scroll horizontally
- int delta = ev->delta() / WHEEL_DELTA;
- int xpixelscale = 5*fast_log10(rmapxDev(1));
+ if (xpixelscale <= 0)
+ xpixelscale = 1;
+ int scrollstep = WHEEL_STEPSIZE * (delta);
+ ///if (ev->state() == Qt::ShiftModifier)
+ // if (((QInputEvent*)ev)->modifiers() == Qt::ShiftModifier)
+ scrollstep = scrollstep / 10;
- if (xpixelscale <= 0)
- xpixelscale = 1;
+ int newXpos = xpos + xpixelscale * scrollstep;
- int scrollstep = WHEEL_STEPSIZE * (delta);
- ///if (ev->state() == Qt::ShiftModifier)
-// if (((QInputEvent*)ev)->modifiers() == Qt::ShiftModifier)
- scrollstep = scrollstep / 10;
+ if (newXpos < 0)
+ newXpos = 0;
- int newXpos = xpos + xpixelscale * scrollstep;
+ //setYPos(newYpos);
+ emit horizontalScroll((unsigned)newXpos);
- if (newXpos < 0)
- newXpos = 0;
- //setYPos(newYpos);
- emit horizontalScroll((unsigned)newXpos);
+ } else if (ctrl) { // zoom horizontally
+ if (ev->delta()>0)
+ emit horizontalZoomIn();
+ else
+ emit horizontalZoomOut();
+ } else { // scroll horizontally
+ emit mouseWheelMoved(ev->delta() / 10);
}
}