]> git.sesse.net Git - kdenlive/blobdiff - src/customtrackview.cpp
Start of image clips
[kdenlive] / src / customtrackview.cpp
index 94ae3628851d01754a51489e6e65356e547118c1..8ab4773cae7f7e2cbf3959b7acc17ba6b335f825 100644 (file)
@@ -300,11 +300,11 @@ void CustomTrackView::addItem(QString producer, QPoint pos)
   doc.setContent(producer);
   QDomElement elem = doc.documentElement();
   int in = elem.attribute("in", 0).toInt();
-  int out = elem.attribute("duration", 0).toInt();
-  if (out == 0) out = elem.attribute("out", 0).toInt() - in;
+  int out = elem.attribute("out", 0).toInt() - in;
+  if (out == 0) out = elem.attribute("duration", 0).toInt();
   kDebug()<<"ADDING CLIP: "<<producer<<", OUT: "<<out<<", POS: "<<mapToScene(pos);
   int trackTop = ((int) mapToScene(pos).y()/50) * 50 + 1;
-  m_dropItem = new ClipItem(elem, ((int) mapToScene(pos).y()/50), in, QRectF(mapToScene(pos).x() * m_scale, trackTop, out * m_scale, 49));
+  m_dropItem = new ClipItem(elem, ((int) mapToScene(pos).y()/50), in, QRectF(mapToScene(pos).x() * m_scale, trackTop, out * m_scale, 49), out);
   scene()->addItem(m_dropItem);
 }