[vlmc-devel] commit: timeline: fix some scrolling artifacts (Ludovic Fauvet )

git at videolan.org git at videolan.org
Mon Mar 22 23:25:54 CET 2010


vlmc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Mon Mar 22 23:02:07 2010 +0100| [4edd1f46f063f1356e8f2a1ae2233dbff5d1b139] | committer: Ludovic Fauvet 

timeline: fix some scrolling artifacts

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

 src/Gui/timeline/TracksView.cpp |   17 +++++++----------
 1 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/Gui/timeline/TracksView.cpp b/src/Gui/timeline/TracksView.cpp
index bf8500f..386f5cb 100644
--- a/src/Gui/timeline/TracksView.cpp
+++ b/src/Gui/timeline/TracksView.cpp
@@ -726,7 +726,8 @@ TracksView::resizeEvent( QResizeEvent *event )
 void
 TracksView::drawBackground( QPainter *painter, const QRectF &rect )
 {
-    painter->setWorldMatrixEnabled( false );
+    // Fill the background
+    painter->fillRect( rect, QBrush( palette().base() ) );
 
     // Draw the tracks separators
     painter->setPen( QPen( QColor( 72, 72, 72 ) ) );
@@ -739,17 +740,12 @@ TracksView::drawBackground( QPainter *painter, const QRectF &rect )
 
         QRectF trackRect = track->mapRectToScene( track->boundingRect() );
         if ( track->mediaType() == MainWorkflow::VideoTrack )
-            painter->drawLine( trackRect.left(), trackRect.top(), rect.right(), trackRect.top() );
+            painter->drawLine( rect.left(), trackRect.top(), rect.right(), trackRect.top() );
         else
-            painter->drawLine( trackRect.left(), trackRect.bottom(), rect.right(), trackRect.bottom() );
+            painter->drawLine( rect.left(), trackRect.bottom(), rect.right(), trackRect.bottom() );
     }
 
     // Audio/Video separator
-    QRectF r = rect;
-    r.setWidth( r.width() + 1 );
-
-    painter->setWorldMatrixEnabled( false );
-
     QLinearGradient g( 0, m_separator->y(), 0, m_separator->y() + m_separator->boundingRect().height() );
     QColor base = palette().window().color();
     QColor end = palette().dark().color();
@@ -760,10 +756,11 @@ TracksView::drawBackground( QPainter *painter, const QRectF &rect )
 
     painter->setBrush( QBrush( g ) );
     painter->setPen( Qt::transparent );
-    painter->drawRect( 0,
+    painter->drawRect( rect.left(),
                        (int) m_separator->y(),
-                       (int) r.right(),
+                       (int) rect.right(),
                        (int) m_separator->boundingRect().height() );
+
 }
 
 void



More information about the Vlmc-devel mailing list