-
- /*&& (event->pos() - m_clickEvent).manhattanLength() >= QApplication::startDragDistance()) {
- double snappedPos = getSnapPointForPos(mapToScene(event->pos()).x() - m_clickPoint.x());
- //kDebug() << "/////// MOVE CLIP, EVENTĀ Y: "<<m_clickPoint.y();//<<event->scenePos().y()<<", SCENE HEIGHT: "<<scene()->sceneRect().height();
- int moveTrack = (int) mapToScene(event->pos() - QPoint(0, (m_dragItem->type() == TRANSITIONWIDGET ? m_dragItem->boundingRect().height() / 2 : 0))).y() / m_tracksHeight;
- int currentTrack = m_dragItem->track();
-
- if (moveTrack > 1000) moveTrack = 0;
- else if (moveTrack > m_scene->m_tracksList.count() - 1) moveTrack = m_scene->m_tracksList.count() - 1;
- else if (moveTrack < 0) moveTrack = 0;
-
- int offset = moveTrack - currentTrack;
- if (m_selectedClipList.count() == 1) m_dragItem->moveTo((int)(snappedPos / m_scale), m_scale, offset * m_tracksHeight, moveTrack);
- else {
- int moveOffset = (int)(snappedPos / m_scale) - m_dragItem->startPos().frames(m_document->fps());
- if (canBeMoved(m_selectedClipList, GenTime(moveOffset, m_document->fps()), offset)) {
- for (int i = 0; i < m_selectedClipList.count(); i++) {
- AbstractClipItem *item = m_selectedClipList.at(i);
- item->moveTo(item->startPos().frames(m_document->fps()) + moveOffset, m_scale, offset * m_tracksHeight, item->track() + offset, false);
- }
- }
- }*/
+ // If mouse is at a border of the view, scroll
+ if (pos < 5) {
+ m_scrollOffset = -20;
+ m_scrollTimer.start();
+ } else if (viewport()->width() - pos < 10) {
+ m_scrollOffset = 20;
+ m_scrollTimer.start();
+ } else if (m_scrollTimer.isActive()) m_scrollTimer.stop();