From 3185a702b24d711e177025b589bb374f4fda1565 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Mardelle Date: Tue, 10 Jun 2008 22:10:48 +0000 Subject: [PATCH] Fix guide snapping & stop animations on timeline zooming svn path=/branches/KDE4/; revision=2247 --- src/customtrackview.cpp | 9 +++++++++ src/guide.cpp | 3 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index feb230e8..c1ccf221 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -1448,6 +1448,15 @@ void CustomTrackView::setTool(PROJECTTOOL tool) { void CustomTrackView::setScale(double scaleFactor) { //scale(scaleFactor, scaleFactor); + m_animationTimer->stop(); + if (m_visualTip) { + delete m_visualTip; + m_visualTip = NULL; + } + if (m_animation) { + delete m_animation; + m_animation = NULL; + } double pos = cursorPos() / m_scale; m_scale = scaleFactor; int vert = verticalScrollBar()->value(); diff --git a/src/guide.cpp b/src/guide.cpp index 1cf781e2..8bd55a89 100644 --- a/src/guide.cpp +++ b/src/guide.cpp @@ -80,8 +80,7 @@ QVariant Guide::itemChange(GraphicsItemChange change, const QVariant &value) { // value is the new position. QPointF newPos = value.toPointF(); newPos.setY(0); - const double offset = m_position.frames(m_fps) * m_scale; - newPos.setX(m_view->getSnapPointForPos(offset + newPos.x()) - offset); + newPos.setX(m_view->getSnapPointForPos(newPos.x())); return newPos; } return QGraphicsItem::itemChange(change, value); -- 2.39.2