]> git.sesse.net Git - kdenlive/blobdiff - src/guide.cpp
- fix guides width being smaller when just added
[kdenlive] / src / guide.cpp
index b6c05a435232fa0d8da5fb81e5d89b07a1934741..08e5e9ef26d422eb79ff1de0a0548d19100b475a 100644 (file)
@@ -38,7 +38,7 @@ Guide::Guide(CustomTrackView *view, GenTime pos, QString label, double fps, doub
     setToolTip(label);
     setLine(0, 0, 0, height);
     setPos(m_position.frames(m_fps), 0);
-    setPen(QPen(QBrush(QColor(0, 0, 200, 180)), 1));
+    setPen(QPen(QBrush(QColor(0, 0, 200, 180)), 2));
     setZValue(999);
     setAcceptsHoverEvents(true);
     const QFontMetrics metric = m_view->fontMetrics();
@@ -116,6 +116,19 @@ QRectF Guide::boundingRect() const
     } else return QGraphicsLineItem::boundingRect();
 }
 
+// virtual
+QPainterPath Guide::shape() const
+{
+    QPainterPath path;
+    path.addRect(line().x1(), line().y1(), line().x2() - line().x1(), line().y2() - line().y1());
+    if (KdenliveSettings::showmarkers()) {
+        const QFontMetrics metric = m_view->fontMetrics();
+        int height = metric.height();
+        path.addRoundedRect(line().x1(), line().y1() + 10, m_width / static_cast <CustomTrackScene*>(scene())->scale(), height, 3, 3);
+    }
+    return path;
+}
+
 // virtual
 void Guide::paint(QPainter *painter, const QStyleOptionGraphicsItem */*option*/, QWidget */*w*/)
 {