Commit 1ee4f1b7 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Fixing length problems

parent 6aaebe24
......@@ -230,7 +230,10 @@ Commands::Effect::Move::redo()
m_old->removeEffect( m_helper );
m_new->addEffect( m_helper );
qint64 offset = m_helper->begin() - m_newPos;
m_helper->setBoundaries( m_newPos, m_helper->end() - offset );
if ( m_helper->end() <= 0 )
m_helper->setBoundaries( m_newPos, ::Effect::TrackEffectDefaultLength );
else
m_helper->setBoundaries( m_newPos, m_helper->end() - offset );
}
else
m_new->moveEffect( m_helper, m_newPos );
......
......@@ -32,6 +32,7 @@ class EffectInstance;
class Effect : public QLibrary
{
public:
static const quint32 TrackEffectDefaultLength = 25 * 60 * 10; //10 minutes at 25fps
enum Type
{
Unknown = -1,
......
......@@ -56,6 +56,6 @@ EffectHelper::setTarget( EffectUser *target )
m_begin = 0;
if ( target != NULL )
m_end = target->length();
else
m_end = -1;
if ( m_end <= 0 ) //Clip can't be 0lengthed, so this case would be a track.
m_end = Effect::TrackEffectDefaultLength; //Have a reasonable default length.
}
......@@ -286,8 +286,6 @@ TracksView::addItem( TrackWorkflow *tw, Workflow::Helper *helper, qint64 start )
EffectHelper *effectHelper = qobject_cast<EffectHelper*>( helper );
Q_ASSERT( effectHelper != NULL );
item = new GraphicsEffectItem( effectHelper );
if ( helper->length() <= 0 )
item->setWidth( maximumWidth() );
}
m_itemsLoaded.insert( helper->uuid() );
item->m_tracksView = this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment