From 48990656b92855e764b6ba5bee91d5949c59e684 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Thu, 5 Feb 2009 13:23:32 +0000 Subject: [PATCH] integrated pitanga's patch to fix unquantized BB dragging in song editor. Changed ctrl modifier to alt to be consistent (stable backport) git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@2008 0778d3d1-df1d-0410-868b-ea421aaaa00d --- ChangeLog | 6 ++++++ src/core/track.cpp | 15 ++++++++++----- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 628d2868c..089b0ca22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,12 @@ * CMakeLists.txt: fixed plugins/ directory when updating localization file + * src/core/track.cpp: + integrated pitanga's patch to fix unquantized BB dragging in + song editor. Changed ctrl modifier to alt to be consistent. + +2009-02-01 Andrew Kelley + * plugins/flp_import/flp_import.cpp: in FL_EffectChannel initialize isMuted member - fixes muted FX channels when importing older FLP files diff --git a/src/core/track.cpp b/src/core/track.cpp index d4e83ba87..913e8e83c 100644 --- a/src/core/track.cpp +++ b/src/core/track.cpp @@ -684,7 +684,7 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) QVector so = m_trackView->getTrackContainerView()->selectedObjects(); QVector tcos; - midiTime smallest_pos; + midiTime smallest_pos, t; // find out smallest position of all selected objects for not // moving an object before zero for( QVector::iterator it = so.begin(); @@ -706,10 +706,15 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me ) for( QVector::iterator it = tcos.begin(); it != tcos.end(); ++it ) { - ( *it )->movePosition( ( *it )->startPosition() + - static_cast( dx * - midiTime::ticksPerTact() / ppt ) - - smallest_pos ); + t = ( *it )->startPosition() + + static_cast( dx *midiTime::ticksPerTact() / + ppt )-smallest_pos; + if( ! ( _me->modifiers() & Qt::AltModifier ) + && _me->button() == Qt::NoButton ) + { + t = t.toNearestTact(); + } + ( *it )->movePosition( t ); } } else if( m_action == Resize )