fixed bug: you can use shift+left to move notes past the beginning (stable backport)

git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/branches/lmms/stable-0.4@1997 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
Tobias Doerffel
2009-02-05 09:06:58 +00:00
parent b3c9bf011b
commit aa575bca83
2 changed files with 19 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
2009-02-04 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
2009-02-05 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
* include/atomic_int.h:
* include/audio_port.h:
@@ -7,6 +7,11 @@
reworked mixer-threads (synchronization, realization of jobqueue etc.)
which results in a much better performance and stability
2009-02-04 Andrew Kelley <superjoe30/at/gmail/dot/com>
* src/gui/piano_roll.cpp:
fixed bug: you can use shift+left to move notes past the beginning
2009-01-25 Paul Giblock <drfaygo/at/gmail/dot/com>
* src/tracks/bb_track.cpp:

View File

@@ -806,13 +806,25 @@ void pianoRoll::shiftPos( int amount ) //shift notes pos by amount
{
bool useAllNotes = ! isSelection();
const noteVector & notes = m_pattern->notes();
bool first = true;
for( noteVector::const_iterator it = notes.begin(); it != notes.end();
++it )
{
// if none are selected, move all notes, otherwise
// only move selected notes
if( useAllNotes || ( *it )->selected() )
if( ( *it )->selected() || (useAllNotes && ( *it )->length() > 0) )
{
// don't let notes go to out of bounds
if( first )
{
m_moveBoundaryLeft = ( *it )->pos();
if( m_moveBoundaryLeft + amount < 0 )
{
amount += 0 - (amount + m_moveBoundaryLeft);
}
first = false;
}
( *it )->setPos( ( *it )->pos() + amount );
}
}