]> git.sesse.net Git - kdenlive/commitdiff
two fixes:
authorAlberto Villa <avilla@FreeBSD.org>
Mon, 11 May 2009 15:18:49 +0000 (15:18 +0000)
committerAlberto Villa <avilla@FreeBSD.org>
Mon, 11 May 2009 15:18:49 +0000 (15:18 +0000)
- when clicking on a guide that's over a clip, move the guide
- if two or more clips are selected and you move a guide, don't move the clips

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

src/customtrackview.cpp

index 8daa5f27e07dda89592422a014fc0c77520963e1..9b489cb16fbf4de13231465b0908ae75f1fe1f99 100644 (file)
@@ -614,19 +614,22 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
         return;
     }
 
-    if (event->button() == Qt::LeftButton && collisionList.count() == 1 && collisionList.at(0)->type() == GUIDEITEM) {
-        // a guide item was pressed
-        collisionList.at(0)->setFlag(QGraphicsItem::ItemIsMovable, true);
-        m_dragItem = NULL;
-        m_dragGuide = (Guide *) collisionList.at(0);
-        collision = true;
-        m_operationMode = MOVEGUIDE;
-        // deselect all clips so that only the guide will move
-        m_scene->clearSelection();
-        resetSelectionGroup();
-        updateSnapPoints(NULL);
-        QGraphicsView::mousePressEvent(event);
-        return;
+    for (int i = 0; event->button() == Qt::LeftButton && i < collisionList.count(); ++i) {
+        // if a guide and a clip were pressed, just move the guide
+        if (collisionList.at(i)->type() == GUIDEITEM) {
+            // a guide item was pressed
+            collisionList.at(i)->setFlag(QGraphicsItem::ItemIsMovable, true);
+            m_dragItem = NULL;
+            m_dragGuide = (Guide *) collisionList.at(i);
+            collision = true;
+            m_operationMode = MOVEGUIDE;
+            // deselect all clips so that only the guide will move
+            m_scene->clearSelection();
+            resetSelectionGroup(false);
+            updateSnapPoints(NULL);
+            QGraphicsView::mousePressEvent(event);
+            return;
+        }
     }
 
     // Find first clip, transition or group under mouse