[vlmc-devel] PreviewRuler: Allow painting to proceed without a Renderer

Hugo Beauzée-Luyssen git at videolan.org
Tue Apr 1 00:13:29 CEST 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Tue Apr  1 01:10:03 2014 +0300| [13563aa136d025ca0d3fa6bc124a0bf11f37e550] | committer: Hugo Beauzée-Luyssen

PreviewRuler: Allow painting to proceed without a Renderer

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

 src/Gui/preview/PreviewRuler.cpp |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/Gui/preview/PreviewRuler.cpp b/src/Gui/preview/PreviewRuler.cpp
index 544de29..d17225e 100644
--- a/src/Gui/preview/PreviewRuler.cpp
+++ b/src/Gui/preview/PreviewRuler.cpp
@@ -54,7 +54,6 @@ void
 PreviewRuler::paintEvent( QPaintEvent * event )
 {
     Q_UNUSED( event );
-    Q_ASSERT( m_renderer );
 
     QPainter painter( this );
     QRect marks( 0, 3, width() - 1, MARK_LARGE + 1 );
@@ -63,7 +62,7 @@ PreviewRuler::paintEvent( QPaintEvent * event )
     painter.setBrush( QBrush( QColor( 50, 50, 50 ) ) );
     painter.drawRect( marks );
 
-    if ( m_renderer->length() > 0 )
+    if ( m_renderer != NULL && m_renderer->length() > 0 )
     {
         qreal linesToDraw = 0;
         qreal spacing = 0;
@@ -174,7 +173,7 @@ PreviewRuler::paintEvent( QPaintEvent * event )
 
     int cursorPos;
 
-    if ( m_renderer->length() > 0 )
+    if ( m_renderer != NULL && m_renderer->length() > 0 )
     {
         cursorPos = m_frame * width() / m_renderer->length();
     }



More information about the Vlmc-devel mailing list