From eb63c03bd57a04efd09f8cc153ee048a29d96946 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 12 Nov 2006 00:48:30 +0000 Subject: [PATCH] we can draw inplace text annotation fully transparent, and be sure to use the alpha color when painting them svn path=/trunk/playground/graphics/okular/; revision=604208 --- ui/pagepainter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ui/pagepainter.cpp b/ui/pagepainter.cpp index 8535ce104..85f3ecaa0 100644 --- a/ui/pagepainter.cpp +++ b/ui/pagepainter.cpp @@ -492,7 +492,9 @@ void PagePainter::paintPageOnPainter( QPainter * destPainter, const Okular::Page // honor opacity settings on supported types unsigned int opacity = (unsigned int)( 255.0 * a->style.opacity ); - if ( opacity <= 0 ) + // skip the annotation drawing if all the annotation is fully + // transparent, but not with text annotations + if ( opacity <= 0 && a->subType() != Okular::Annotation::AText ) continue; // get annotation boundary and drawn rect @@ -517,7 +519,7 @@ void PagePainter::paintPageOnPainter( QPainter * destPainter, const Okular::Page // otherwise draw it right after the text bool bigger = mixedPainter->device()->width() > page->width(); QImage image( bigRect.size(), QImage::Format_ARGB32 ); - image.fill( qRgba( a->style.color.red(), a->style.color.green(), a->style.color.blue(), 255 ) ); + image.fill( qRgba( a->style.color.red(), a->style.color.green(), a->style.color.blue(), opacity ) ); QPainter painter( &image ); painter.setPen( Qt::black ); painter.setFont( text->textFont );