mlt_properties_set_int( producer_props, "_animated", 1 );
QStringList effetData = QStringList() << "typewriter" << text << txtProperties.namedItem( "typewriter" ).nodeValue();
txt->setData(0, effetData);
+ if ( !txtProperties.namedItem( "textwidth" ).isNull() )
+ txt->setData( 1, txtProperties.namedItem( "textwidth" ).nodeValue() );
}
if ( txtProperties.namedItem( "alignment" ).isNull() == false )
// the keystroke delay and a start offset, both in frames
QStringList values = params.at( 2 ).split( ";" );
int interval = qMax( 0, ( ( int ) position - values.at( 1 ).toInt()) / values.at( 0 ).toInt() );
- qRegisterMetaType<QTextCursor>( "QTextCursor" );
- QTextCursor cursor = titem->textCursor();
+ qRegisterMetaType<QTextCursor>( "QTextCursor" );
+ QTextCursor cursor = titem->textCursor();
cursor.movePosition(QTextCursor::EndOfBlock);
// get the font format
QTextCharFormat format = cursor.charFormat();
cursor.select(QTextCursor::Document);
QString txt = params.at( 1 ).left( interval );
- // If the string to insert is empty, insert a space so that we don't loose
+ // If the string to insert is empty, insert a space / linebreak so that we don't loose
// formatting infos for the next iterations
- cursor.insertText(txt.isEmpty() ? " " : txt, format);
+ int lines = params.at( 1 ).count( '\n' );
+ QString empty = " ";
+ for (int i = 0; i < lines; i++)
+ empty.append( "\n " );
+ cursor.insertText( txt.isEmpty() ? empty : txt, format );
+ if ( !titem->data( 1 ).isNull() )
+ titem->setTextWidth( titem->data( 1 ).toInt() );
}
}
}