From be3602df32ac67e0f65db2ebd3e7b5ec5b46702e Mon Sep 17 00:00:00 2001 From: DreamSourceLab Date: Wed, 24 Jun 2015 22:23:47 +0800 Subject: [PATCH] improve mouse drag-and-drop effect --- DSView/pv/view/viewport.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DSView/pv/view/viewport.cpp b/DSView/pv/view/viewport.cpp index e80cbd5c..32652017 100644 --- a/DSView/pv/view/viewport.cpp +++ b/DSView/pv/view/viewport.cpp @@ -512,10 +512,10 @@ void Viewport::mouseReleaseEvent(QMouseEvent *event) _drag_sig.reset(); const double strength = _drag_strength*DragTimerInterval*1.0/_time.elapsed(); - if (_drag_strength < MinorDragOffsetUp && abs(strength) > MinorDragRateUp) { + if (abs(_drag_strength) < MinorDragOffsetUp && abs(strength) > MinorDragRateUp) { _drag_strength = _drag_strength; _drag_timer.start(DragTimerInterval); - } else if (abs(strength) > 0.5*DragTimerInterval) { + } else if (abs(strength) > DragTimerInterval) { _drag_strength = strength * 5; _drag_timer.start(DragTimerInterval); } else {