From: Marco Gittler Date: Sat, 8 Mar 2008 15:42:04 +0000 (+0000) Subject: crop left audio thumbs (needs correct scale value in line 290) X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=ba60bcdca1fdb3f1dac00632e33087602c62a4b9;p=kdenlive crop left audio thumbs (needs correct scale value in line 290) svn path=/branches/KDE4/; revision=2014 --- diff --git a/src/clipitem.cpp b/src/clipitem.cpp index ebec5e33..08523409 100644 --- a/src/clipitem.cpp +++ b/src/clipitem.cpp @@ -207,6 +207,7 @@ void ClipItem::paint(QPainter *painter, clippath.addRect(rectInView); int startpixel = (int)(rectInView.x() - rect().x()); //start and endpixel that is viewable from rect() + if (startpixel < 0) startpixel = 0; int endpixel = rectInView.width() + rectInView.x(); @@ -286,10 +287,10 @@ void ClipItem::paint(QPainter *painter, if (pixelForOneFrame != framePixelWidth) audioThumbCachePic.clear(); emit prepareAudioThumb(pixelForOneFrame, path, startpixel, endpixel + 200);//200 more for less missing parts before repaint after scrolling - + int cropLeft = (m_cropStart).frames(m_fps) * 10; for (int startCache = startpixel - startpixel % 100; startCache < endpixel + 300;startCache += 100) { if (audioThumbCachePic.contains(startCache) && !audioThumbCachePic[startCache].isNull()) - painter->drawPixmap((int)(roundRectPathUpper.united(roundRectPathLower).boundingRect().x() + startCache), (int)(path.boundingRect().y()), audioThumbCachePic[startCache]); + painter->drawPixmap((int)(roundRectPathUpper.united(roundRectPathLower).boundingRect().x() + startCache - cropLeft), (int)(path.boundingRect().y()), audioThumbCachePic[startCache]); } }