Track: allow resizing TrackContentObjects to less than one bar

As per popular demand, allow resizing TrackContentObjects to less than
one bar if appropriate subclass supports it.
This commit is contained in:
Tobias Doerffel
2014-01-19 22:58:32 +01:00
parent aeefec9ac3
commit ec5e9f16d5

View File

@@ -713,13 +713,10 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
}
else if( m_action == Resize )
{
midiTime t = qMax( midiTime::ticksPerTact(),
static_cast<int>( _me->x() *
midiTime::ticksPerTact() / ppt ) );
if( ! ( _me->modifiers() & Qt::ControlModifier )
&& _me->button() == Qt::NoButton )
midiTime t = qMax( midiTime::ticksPerTact() / 16, static_cast<int>( _me->x() * midiTime::ticksPerTact() / ppt ) );
if( ! ( _me->modifiers() & Qt::ControlModifier ) && _me->button() == Qt::NoButton )
{
t = t.toNearestTact();
t = qMax<int>( midiTime::ticksPerTact(), t.toNearestTact() );
}
m_tco->changeLength( t );
s_textFloat->setText( tr( "%1:%2 (%3:%4 to %5:%6)" ).