]> git.sesse.net Git - kdenlive/commitdiff
Don't allow negative guides
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 31 Jan 2010 19:49:06 +0000 (19:49 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 31 Jan 2010 19:49:06 +0000 (19:49 +0000)
svn path=/trunk/kdenlive/; revision=4258

src/guide.cpp

index 49b304c71cc03693c0befda83ac9885dddcd847b..299a82b07f8b4f4b7659f855232601fe38ccbd65 100644 (file)
@@ -40,6 +40,7 @@ Guide::Guide(CustomTrackView *view, GenTime pos, QString label, double height) :
 #endif
     setToolTip(label);
     setLine(0, 0, 0, height);
+    if (m_position < GenTime()) m_position = GenTime();
     setPos(m_position.frames(m_view->fps()), 0);
     m_pen.setWidthF(0);
     m_pen.setColor(QColor(0, 0, 200, 180));
@@ -113,6 +114,7 @@ QVariant Guide::itemChange(GraphicsItemChange change, const QVariant &value)
         QPointF newPos = value.toPointF();
         newPos.setY(0);
         newPos.setX(m_view->getSnapPointForPos(newPos.x()));
+        if (newPos.x() < 0.0) newPos.setX(0.0);
         return newPos;
     }
     return QGraphicsItem::itemChange(change, value);