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));
bool move = (event->pos() - m_clickEvent).manhattanLength() >= QApplication::startDragDistance();
if (m_dragItem && m_tool == SELECTTOOL) {
if (m_operationMode == MOVE && move) {
+ //m_dragItem->setProperty("y_absolute", event->pos().y());
QGraphicsView::mouseMoveEvent(event);
// If mouse is at a border of the view, scroll
if (pos < 5) {
else
m_dragItem = collisionClip;
found = true;
+ m_dragItem->setProperty("y_absolute", m_clickEvent.y() - m_dragItem->scenePos().y());
m_dragItemInfo = m_dragItem->info();
if (m_dragItem->parentItem() && m_dragItem->parentItem()->type() == GROUPWIDGET && m_dragItem->parentItem() != m_selectionGroup) {
// kDebug()<<"// KLIK FOUND GRP: "<<m_dragItem->sceneBoundingRect();