]> git.sesse.net Git - kdenlive/commitdiff
Fix clip border not correctly drawn, should solve part 2 of this bug:
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 31 Oct 2008 13:38:12 +0000 (13:38 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Fri, 31 Oct 2008 13:38:12 +0000 (13:38 +0000)
http://www.kdenlive.org:80/mantis/view.php?id=194

svn path=/branches/KDE4/; revision=2609

src/clipitem.cpp
src/transition.cpp

index e9f81b2cfa18a2d7b16663ec29d4c9d763aa82b7..264d9309095fcd8d7c073616934007ca5d1203a0 100644 (file)
@@ -484,7 +484,6 @@ void ClipItem::paint(QPainter *painter,
     const double scale = option->matrix.m11();
 
 
-
     //painter->setRenderHints(QPainter::Antialiasing);
 
     //QPainterPath roundRectPathUpper = upperRectPart(br), roundRectPathLower = lowerRectPart(br);
@@ -692,11 +691,10 @@ void ClipItem::paint(QPainter *painter,
 
     //kDebug()<<"/// ITEM PAINTING:: exposed="<<exposed<<", RECT = "<<rect();
 
-    exposed.setRight(exposed.right() + 1);
+    // expand clip rect to allow correct painting of clip border
+    exposed.setRight(exposed.right() + 1 / scale + 0.5);
     exposed.setBottom(exposed.bottom() + 1);
     painter->setClipRect(exposed);
-    //painter->setClipping(false);
-    //painter->fillRect(exposed, Qt::blue);
     painter->setPen(pen);
     painter->drawRect(br);
 }
index 2ed6523a36a25859415590d0329a89a4c26a5fbb..897dbfed6ffead4b452d5c3e23d10bc65eb22a32 100644 (file)
@@ -124,9 +124,8 @@ void Transition::updateTransitionEndTrack(int newtrack) {
 void Transition::paint(QPainter *painter,
                        const QStyleOptionGraphicsItem *option,
                        QWidget *widget) {
+    const double scale = option->matrix.m11();
     QRectF exposed = option->exposedRect;
-    exposed.setRight(exposed.right() + 1);
-    exposed.setBottom(exposed.bottom() + 1);
     painter->setClipRect(exposed);
     QRectF br = rect();
     m_gradient.setStart(0, br.y());
@@ -153,6 +152,10 @@ void Transition::paint(QPainter *painter,
         pen.setColor(Qt::black);
         //pen.setWidth(1);
     }
+    // expand clip rect to allow correct painting of clip border
+    exposed.setRight(exposed.right() + 1 / scale + 0.5);
+    exposed.setBottom(exposed.bottom() + 1);
+    painter->setClipRect(exposed);
     painter->setPen(pen);
     painter->drawRect(br);
 }