summaryrefslogtreecommitdiff
path: root/muse2/muse/waveedit
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-09-01 17:30:59 +0000
committerFlorian Jung <flo@windfisch.org>2011-09-01 17:30:59 +0000
commit46369b4c33d841aa1ece363c3deb3775658165ad (patch)
tree73f923e0ee3d6d103957a507372ed3ad2666422d /muse2/muse/waveedit
parente64c6677de790368781f7d9f1ba1c98bcfc521d2 (diff)
parent1414d8185ca9bc0b078cff7512482f013e28bde3 (diff)
merged with trunk
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);
}
}