originalWidth = scene->sceneRect().width();
originalHeight = scene->sceneRect().height();
}
+ if ( title.hasAttribute( "out" ) ) {
+ mlt_properties_set_position( producer_props, "_animation_out", title.attribute( "out" ).toDouble() );
+ }
+ else {
+ mlt_properties_set_position( producer_props, "_animation_out", mlt_producer_get_out( producer ) );
+ }
+
mlt_properties_set_int( producer_props, "_original_width", originalWidth );
mlt_properties_set_int( producer_props, "_original_height", originalHeight );
p1.begin( &img );
p1.setRenderHints( QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::HighQualityAntialiasing );
//| QPainter::SmoothPixmapTransform );
+ mlt_position anim_out = mlt_properties_get_position( producer_props, "_animation_out" );
+
if (end.isNull())
{
scene->render( &p1, source, start, Qt::IgnoreAspectRatio );
}
- else
- {
- QPointF topleft = start.topLeft() + ( end.topLeft() - start.topLeft() ) * position;
- QPointF bottomRight = start.bottomRight() + ( end.bottomRight() - start.bottomRight() ) * position;
+ else if ( position > anim_out ) {
+ scene->render( &p1, source, end, Qt::IgnoreAspectRatio );
+ }
+ else {
+ double percentage = position / anim_out;
+ QPointF topleft = start.topLeft() + ( end.topLeft() - start.topLeft() ) * percentage;
+ QPointF bottomRight = start.bottomRight() + ( end.bottomRight() - start.bottomRight() ) * percentage;
const QRectF r1( topleft, bottomRight );
scene->render( &p1, source, r1, Qt::IgnoreAspectRatio );
}
/* Allocate the image */
*format = mlt_image_rgb24a;
- mlt_position in = mlt_producer_get_in( &this->parent );
- mlt_position out = mlt_producer_get_out( &this->parent );
- mlt_position time = mlt_producer_position( &this->parent );
- double position = ( double )( time - in ) / ( double )( out - in + 1 );
+ mlt_position time = mlt_producer_position( &this->parent ) + mlt_producer_get_in( &this->parent );
if ( mlt_properties_get_int( producer_props, "force_reload" ) ) {
if (mlt_properties_get_int( producer_props, "force_reload" ) > 1) read_xml(producer_props);
mlt_properties_set_int( producer_props, "force_reload", 0 );
- drawKdenliveTitle( this, frame, *width, *height, position, 1);
+ drawKdenliveTitle( this, frame, *width, *height, time, 1);
}
- else drawKdenliveTitle( this, frame, *width, *height, position, 0);
+ else drawKdenliveTitle( this, frame, *width, *height, time, 0);
// Get width and height (may have changed during the refresh)
*width = mlt_properties_get_int( properties, "width" );