]> git.sesse.net Git - kdenlive/blobdiff - src/guide.cpp
Full screen video playback:
[kdenlive] / src / guide.cpp
index ef254ce94326d3a00b7297a0d1ad290e9321322f..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);
@@ -125,7 +127,7 @@ QRectF Guide::boundingRect() const
     double width = m_pen.widthF() / scale * 2;
     QRectF rect(line().x1() - width / 2 , line().y1(), width, line().y2() - line().y1());
     if (KdenliveSettings::showmarkers()) {
-        rect.setWidth(width + m_width / scale);
+        rect.setWidth(width + m_width);
     }
     return rect;
 }
@@ -135,12 +137,11 @@ QPainterPath Guide::shape() const
 {
     QPainterPath path;
     if (!scene()) return path;
-    double scale = m_view->matrix().m11();
-    double width = m_pen.widthF() / scale * 2;
+    double width = m_pen.widthF() * 2;
     path.addRect(line().x1() - width / 2 , line().y1(), width, line().y2() - line().y1());
     if (KdenliveSettings::showmarkers()) {
         const QFontMetrics metric = m_view->fontMetrics();
-        QRectF txtBounding(line().x1() + 1 / scale, line().y1() + 10, m_width / scale, metric.height() / m_view->matrix().m22());
+        QRectF txtBounding(line().x1(), line().y1() + 10, m_width, metric.height());
         path.addRect(txtBounding);
     }
     return path;