Changeset View
Changeset View
Standalone View
Standalone View
ui/pagepainter.cpp
Show First 20 Lines • Show All 680 Lines • ▼ Show 20 Line(s) | 655 | { | |||
---|---|---|---|---|---|
681 | { | 681 | { | ||
682 | Okular::TextAnnotation * text = (Okular::TextAnnotation *)a; | 682 | Okular::TextAnnotation * text = (Okular::TextAnnotation *)a; | ||
683 | if ( text->textType() == Okular::TextAnnotation::InPlace ) | 683 | if ( text->textType() == Okular::TextAnnotation::InPlace ) | ||
684 | { | 684 | { | ||
685 | QImage image( annotBoundary.size(), QImage::Format_ARGB32 ); | 685 | QImage image( annotBoundary.size(), QImage::Format_ARGB32 ); | ||
686 | image.fill( acolor.rgba() ); | 686 | image.fill( acolor.rgba() ); | ||
687 | QPainter painter( &image ); | 687 | QPainter painter( &image ); | ||
688 | painter.setFont( text->textFont() ); | 688 | painter.setFont( text->textFont() ); | ||
689 | painter.setPen( text->textColor() ); | ||||
689 | Qt::AlignmentFlag halign = ( text->inplaceAlignment() == 1 ? Qt::AlignHCenter : ( text->inplaceAlignment() == 2 ? Qt::AlignRight : Qt::AlignLeft ) ); | 690 | Qt::AlignmentFlag halign = ( text->inplaceAlignment() == 1 ? Qt::AlignHCenter : ( text->inplaceAlignment() == 2 ? Qt::AlignRight : Qt::AlignLeft ) ); | ||
690 | const double invXScale = (double)page->width() / scaledWidth; | 691 | const double invXScale = (double)page->width() / scaledWidth; | ||
691 | const double invYScale = (double)page->height() / scaledHeight; | 692 | const double invYScale = (double)page->height() / scaledHeight; | ||
692 | const double borderWidth = text->style().width(); | 693 | const double borderWidth = text->style().width(); | ||
693 | painter.scale( 1 / invXScale, 1 / invYScale ); | 694 | painter.scale( 1 / invXScale, 1 / invYScale ); | ||
694 | painter.drawText( borderWidth * invXScale, borderWidth * invYScale, | 695 | painter.drawText( borderWidth * invXScale, borderWidth * invYScale, | ||
695 | (image.width() - 2 * borderWidth) * invXScale, | 696 | (image.width() - 2 * borderWidth) * invXScale, | ||
696 | (image.height() - 2 * borderWidth) * invYScale, | 697 | (image.height() - 2 * borderWidth) * invYScale, | ||
▲ Show 20 Lines • Show All 307 Lines • Show Last 20 Lines |