[vlmc-devel] timeline: improve cursor rendering

Ludovic Fauvet git at videolan.org
Sun Mar 2 12:47:18 CET 2014


vlmc | branch: master | Ludovic Fauvet <etix at videolan.org> | Sun Mar  2 12:46:25 2014 +0100| [2434f2b29443f4866fe835ea66b7ac319a4a14af] | committer: Ludovic Fauvet

timeline: improve cursor rendering

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=2434f2b29443f4866fe835ea66b7ac319a4a14af
---

 src/Gui/timeline/TracksRuler.cpp |    5 +++--
 src/Gui/timeline/TracksView.cpp  |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/Gui/timeline/TracksRuler.cpp b/src/Gui/timeline/TracksRuler.cpp
index efbee84..41280b7 100644
--- a/src/Gui/timeline/TracksRuler.cpp
+++ b/src/Gui/timeline/TracksRuler.cpp
@@ -162,10 +162,11 @@ TracksRuler::paintEvent( QPaintEvent* e )
             painter.drawLine( ( int )f, BIG_MARK_X1, ( int )f, BIG_MARK_X2 );
 
     // Draw the pointer
-    int cursorPos = m_tracksView->cursorPos() * m_factor - offset();
+    int cursorPos = m_tracksView->cursorPos() * m_factor + 0.5 - offset();
     QPolygon cursor( 3 );
-    cursor.setPoints( 3, cursorPos - 9, 11, cursorPos + 9, 11, cursorPos, 30 );
+    cursor.setPoints( 3, cursorPos - 8, 15, cursorPos + 8, 15, cursorPos, 30 );
     painter.setBrush( QBrush( QColor( 82, 97, 122, 150 ) ) );
+    painter.setRenderHint(QPainter::Antialiasing, true);
     painter.drawPolygon( cursor );
 }
 
diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index bde807e..89e2002 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -81,7 +81,7 @@ TracksView::TracksView( QGraphicsScene *scene, MainWorkflow *mainWorkflow,
     setAlignment( Qt::AlignLeft | Qt::AlignTop );
     setCacheMode( QGraphicsView::CacheBackground );
 
-    m_cursorLine = new GraphicsCursorItem( QPen( QColor( 220, 30, 30 ) ) );
+    m_cursorLine = new GraphicsCursorItem( QPen( QColor( 255, 0, 0, 125 ), 2 ) );
 
     m_scene->addItem( m_cursorLine );
 



More information about the Vlmc-devel mailing list