]> git.sesse.net Git - kdenlive/commitdiff
draw fix for path of audio area and clear all cache pics if zoom changed
authorMarco Gittler <marco@gitma.de>
Sun, 2 Mar 2008 17:31:39 +0000 (17:31 +0000)
committerMarco Gittler <marco@gitma.de>
Sun, 2 Mar 2008 17:31:39 +0000 (17:31 +0000)
svn path=/branches/KDE4/; revision=1978

src/clipitem.cpp

index 0c9f7e8d442810469ca77db0f7101e9487637351..214c00f0a9d5cdb34abea890542b763eccd8cbf2 100644 (file)
@@ -275,7 +275,8 @@ void ClipItem::animate(qreal value)
                 
                 int channels=2;
                 double pixelForOneFrame=(double)br.width()/duration();
-
+               if (pixelForOneFrame!=framePixelWidth)
+                       audioThumbCachePic.clear();
                 emit prepareAudioThumb(pixelForOneFrame,path,startpixel,endpixel+200);//200 more for less missing parts before repaint after scrolling
 
                 for (int startCache=startpixel-startpixel%100; startCache < endpixel+300;startCache+=100){
@@ -431,12 +432,13 @@ void ClipItem::slotPrepareAudioThumb(double pixelForOneFrame,QPainterPath path,i
                                                negativeChannelPaths[channel].lineTo(samples,0.1+y-delta);
                                        }
                                }
-                               if (fullAreaDraw && samples==100){
-                                       positiveChannelPaths[channels].lineTo(samples,0);
-                                       negativeChannelPaths[channels].lineTo(samples,0);
-                                       positiveChannelPaths[channels].lineTo(0,0);
-                                       negativeChannelPaths[channels].lineTo(0,0);
-                               }
+                               for (int channel=0;channel<channels ;channel++)
+                                       if (fullAreaDraw && samples==100){
+                                               positiveChannelPaths[channel].lineTo(samples,channelHeight*channel+ channelHeight/2);
+                                               negativeChannelPaths[channel].lineTo(samples,channelHeight*channel+ channelHeight/2);
+                                               positiveChannelPaths[channel].lineTo(0,channelHeight*channel+ channelHeight/2);
+                                               negativeChannelPaths[channel].lineTo(0,channelHeight*channel+ channelHeight/2);
+                                       }
                                        
                        }
                        for (int i=0;i<channels;i++){