X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftransition.cpp;h=f10befc4537d01daabc2e52a708a02848f08d265;hb=a3b6a34d67b2a04c13f63a30092acde2fc821455;hp=27f66cd65afafc9f7deab65b2601c6fe0ec80292;hpb=f41770656c58ffc541441d04a3845cd1005fcdcf;p=kdenlive diff --git a/src/transition.cpp b/src/transition.cpp index 27f66cd6..f10befc4 100644 --- a/src/transition.cpp +++ b/src/transition.cpp @@ -161,22 +161,26 @@ void Transition::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget */*widget*/) { - const QRectF exposed = option->exposedRect; - painter->setClipRect(exposed); + const QRectF exposed = painter->worldTransform().mapRect(option->exposedRect); const QRectF br = rect(); QPen framePen; + framePen.setWidthF(1.2); const QRectF mapped = painter->worldTransform().mapRect(br); - painter->fillRect(exposed, brush()); - QPointF p1(br.x(), br.y() + br.height() / 2 - 7); painter->setWorldMatrixEnabled(false); + QPainterPath p; + p.addRect(exposed); + QPainterPath q; + q.addRoundedRect(mapped.adjusted(0, 0, -1, -1), 3, 3); + painter->setClipPath(p.intersected(q)); + painter->fillRect(exposed, brush()); const QString text = m_name + (m_forceTransitionTrack ? "|>" : QString()); // Draw clip name if (isSelected() || (parentItem() && parentItem()->isSelected())) { - framePen.setColor(Qt::red); - framePen.setWidthF(2.0); + framePen.setColor(scene()->palette().highlight().color()); + framePen.setColor(Qt::red); } else { framePen.setColor(brush().color().darker()); @@ -194,7 +198,8 @@ void Transition::paint(QPainter *painter, // Draw frame painter->setPen(framePen); painter->setClipping(false); - painter->drawRect(mapped.adjusted(0, 0, -0.5, -0.5)); + painter->setRenderHint(QPainter::Antialiasing, true); + painter->drawRoundedRect(mapped.adjusted(0, 0, -0.5, -0.5), 3, 3); } int Transition::type() const