]> git.sesse.net Git - kdenlive/commitdiff
Fix guide snapping & stop animations on timeline zooming
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 10 Jun 2008 22:10:48 +0000 (22:10 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Tue, 10 Jun 2008 22:10:48 +0000 (22:10 +0000)
svn path=/branches/KDE4/; revision=2247

src/customtrackview.cpp
src/guide.cpp

index feb230e8773b55ee8fb747a161bd8ec538d903ca..c1ccf221e28f1b2381944eb1881ac174109f45cf 100644 (file)
@@ -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();
index 1cf781e211e30cec6f73ec7f6a9284fc8fa3efd4..8bd55a89e6b6b2a130d095824bbeaadc7e690378 100644 (file)
@@ -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);