From b0bb617c95b1819ab9d8b63be38c3a2992560ba2 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Fri, 7 Aug 2020 00:36:29 +0200 Subject: [PATCH] buildPen: honor annotation opacity Otherwise changing the opacity of lines/arrows does nothing --- ui/pagepainter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/pagepainter.cpp b/ui/pagepainter.cpp index dab6a4f07..4159981bc 100644 --- a/ui/pagepainter.cpp +++ b/ui/pagepainter.cpp @@ -43,7 +43,9 @@ Q_GLOBAL_STATIC_WITH_ARGS(QPixmap, busyPixmap, (KIconLoader::global()->loadIcon( inline QPen buildPen(const Okular::Annotation *ann, double width, const QColor &color) { - QPen p(QBrush(color), width, ann->style().lineStyle() == Okular::Annotation::Dashed ? Qt::DashLine : Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); + QColor c = color; + c.setAlphaF(ann->style().opacity()); + QPen p(QBrush(c), width, ann->style().lineStyle() == Okular::Annotation::Dashed ? Qt::DashLine : Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); return p; }