]> git.sesse.net Git - kdenlive/blobdiff - src/clipitem.cpp
Workaround dragging timeline clips on another track not reliable:
[kdenlive] / src / clipitem.cpp
index e00b59b4c06707616a961470c565a97cca0de3e5..ba8cb455666ff5a8b6ef6a81511c2f1c678c91f2 100644 (file)
@@ -1301,7 +1301,9 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
         int xpos = projectScene()->getSnapPointForPos((int) newPos.x(), KdenliveSettings::snaptopoints());
         xpos = qMax(xpos, 0);
         newPos.setX(xpos);
-        int newTrack = newPos.y() / KdenliveSettings::trackheight();
+       // Warning: newPos gives a position relative to the click event, so hack to get absolute pos
+       int yOffset = property("y_absolute").toInt() + newPos.y();
+        int newTrack = yOffset / KdenliveSettings::trackheight();
         newTrack = qMin(newTrack, projectScene()->tracksCount() - 1);
         newTrack = qMax(newTrack, 0);
         newPos.setY((int)(newTrack  * KdenliveSettings::trackheight() + 1));