diff --git a/src/gui/TimeLineWidget.cpp b/src/gui/TimeLineWidget.cpp index c9c951901..dc6537ab7 100644 --- a/src/gui/TimeLineWidget.cpp +++ b/src/gui/TimeLineWidget.cpp @@ -238,7 +238,8 @@ void TimeLineWidget::paintEvent( QPaintEvent * ) p.fillRect( 0, 0, width(), height(), p.background() ); // Clip so that we only draw everything starting from the offset - p.setClipRect( m_xOffset, 0, width() - m_xOffset, height() ); + const int leftMargin = m_xOffset + s_posMarkerPixmap->width() / 2; + p.setClipRect(leftMargin, 0, width() - leftMargin, height() ); // Draw the loop rectangle int const & loopRectMargin = getLoopRectangleVerticalPadding(); @@ -296,9 +297,14 @@ void TimeLineWidget::paintEvent( QPaintEvent * ) p.setBrush( Qt::NoBrush ); p.drawRect( innerRectangle ); - // Draw the position marker - p.setOpacity( 0.6 ); - p.drawPixmap( m_posMarkerX, height() - s_posMarkerPixmap->height(), *s_posMarkerPixmap ); + // Only draw the position marker if the position line is in view + if (m_posMarkerX >= m_xOffset && m_posMarkerX < width() - s_posMarkerPixmap->width() / 2) + { + // Let the position marker extrude to the left + p.setClipping(false); + p.setOpacity(0.6); + p.drawPixmap(m_posMarkerX, height() - s_posMarkerPixmap->height(), *s_posMarkerPixmap); + } }