]> git.sesse.net Git - kdenlive/commitdiff
Fix spacer accuracy:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 25 Nov 2009 21:21:51 +0000 (21:21 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 25 Nov 2009 21:21:51 +0000 (21:21 +0000)
http://kdenlive.org/mantis/view.php?id=1311

svn path=/trunk/kdenlive/; revision=4149

src/customtrackview.cpp
src/customtrackview.h

index 66ac55f180d5b0e909f968d229e3c45265e45ab3..e9856fdfbd2636fa90facaf114d05197be0d472c 100644 (file)
@@ -405,6 +405,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
             return;
         } else if (m_operationMode == SPACER && move && m_selectionGroup) {
             // spacer tool
+           snappedPos = getSnapPointForPos(mappedXPos + m_spacerOffset);
             if (snappedPos < 0) snappedPos = 0;
             // Make sure there is no collision
             QList<QGraphicsItem *> children = m_selectionGroup->childItems();
@@ -868,7 +869,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
                     selection.at(i)->parentItem()->setFlag(QGraphicsItem::ItemIsMovable, false);
                 }
             }
-
+           m_spacerOffset = m_selectionGroup->sceneBoundingRect().left() - (int)(mapToScene(m_clickEvent).x());
             if (!offsetList.isEmpty()) {
                 qSort(offsetList);
                 QList <GenTime> cleandOffsetList;
index 01505b78a755f0a53a51a59ebedae1b82a48bc05..88275ca6ec6cda7a5cb19943cda92e319491b189 100644 (file)
@@ -244,6 +244,7 @@ private:
     AbstractGroupItem *m_selectionGroup;
     QList <ClipItem *> m_waitingThumbs;
     int m_selectedTrack;
+    int m_spacerOffset;
 
     /** Get the index of the video track that is just below current track */
     int getPreviousVideoTrack(int track);