X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fcustomruler.cpp;h=645ecb0f525923f04b68d72ea226ca9ea555b0f9;hb=691411ad08e02a64c3bb4c6603da0ba204afe9fb;hp=ae5555ccc6afa4eb9d8864ede8a78a74cf9a252a;hpb=0d59a0487e34d72a58cde6f58b7499d8f6ef404b;p=kdenlive diff --git a/src/customruler.cpp b/src/customruler.cpp index ae5555cc..645ecb0f 100644 --- a/src/customruler.cpp +++ b/src/customruler.cpp @@ -181,11 +181,13 @@ void CustomRuler::mousePressEvent(QMouseEvent * event) // virtual void CustomRuler::mouseMoveEvent(QMouseEvent * event) { + int mappedXPos = (int)((event->x() + offset()) / m_factor); + emit mousePosition(mappedXPos); if (event->buttons() == Qt::LeftButton) { int pos; if (m_moveCursor == RULER_START || m_moveCursor == RULER_END) { - pos = m_view->getSnapPointForPos((int)((event->x() + offset()) / m_factor)); - } else pos = (int)((event->x() + offset()) / m_factor); + pos = m_view->getSnapPointForPos(mappedXPos); + } else pos = mappedXPos; int zoneStart = m_zoneStart; int zoneEnd = m_zoneEnd; if (pos < 0) pos = 0;