diff --git a/ui/pagepainter.cpp b/ui/pagepainter.cpp index 641f5e69d..dab6a4f07 100644 --- a/ui/pagepainter.cpp +++ b/ui/pagepainter.cpp @@ -1105,14 +1105,14 @@ void LineAnnotPainter::draw(QImage &image) const void LineAnnotPainter::drawMainLine(QImage &image) const { // draw the line as normalized path into image - PagePainter::drawShapeOnImage(image, transformPath(la->transformedLinePoints(), toNormalizedImage), la->lineClosed(), linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawShapeOnImage(image, transformPath(la->transformedLinePoints(), toNormalizedImage), la->lineClosed(), linePen, fillBrush, pageScale); } void LineAnnotPainter::drawShortenedLine(double mainSegmentLength, double size, QImage &image, const QTransform &toNormalizedPage) const { const QTransform combinedTransform {toNormalizedPage * toNormalizedImage}; const QList path {{shortenForArrow(size, la->lineStartStyle()), 0}, {mainSegmentLength - shortenForArrow(size, la->lineEndStyle()), 0}}; - PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), la->lineClosed(), linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), la->lineClosed(), linePen, fillBrush, pageScale); } void LineAnnotPainter::drawLineEnds(double mainSegmentLength, double size, QImage &image, const QTransform &transform) const @@ -1189,7 +1189,7 @@ void LineAnnotPainter::drawLineEndArrow(double xEndPos, double size, double flip {xEndPos, 0}, {xEndPos - size * flipX, -size / 2.}, }; - PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), close, linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), close, linePen, fillBrush, pageScale); } void LineAnnotPainter::drawLineEndButt(double xEndPos, double size, const QTransform &toNormalizedPage, QImage &image) const @@ -1200,7 +1200,7 @@ void LineAnnotPainter::drawLineEndButt(double xEndPos, double size, const QTrans {xEndPos, halfSize}, {xEndPos, -halfSize}, }; - PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), true, linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), true, linePen, fillBrush, pageScale); } void LineAnnotPainter::drawLineEndCircle(double xEndPos, double size, const QTransform &toNormalizedPage, QImage &image) const @@ -1216,21 +1216,21 @@ void LineAnnotPainter::drawLineEndCircle(double xEndPos, double size, const QTra }; /* then transform bounding rect with toNormalizedImage */ - PagePainter::drawEllipseOnImage(image, transformPath(path, toNormalizedImage), linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawEllipseOnImage(image, transformPath(path, toNormalizedImage), linePen, fillBrush, pageScale); } void LineAnnotPainter::drawLineEndSquare(double xEndPos, double size, const QTransform &toNormalizedPage, QImage &image) const { const QTransform combinedTransform {toNormalizedPage * toNormalizedImage}; const QList path {{xEndPos, size / 2.}, {xEndPos - size, size / 2.}, {xEndPos - size, -size / 2.}, {xEndPos, -size / 2.}}; - PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), true, linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), true, linePen, fillBrush, pageScale); } void LineAnnotPainter::drawLineEndDiamond(double xEndPos, double size, const QTransform &toNormalizedPage, QImage &image) const { const QTransform combinedTransform {toNormalizedPage * toNormalizedImage}; const QList path {{xEndPos, 0}, {xEndPos - size / 2., size / 2.}, {xEndPos - size, 0}, {xEndPos - size / 2., -size / 2.}}; - PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), true, linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), true, linePen, fillBrush, pageScale); } void LineAnnotPainter::drawLineEndSlash(double xEndPos, double size, const QTransform &toNormalizedPage, QImage &image) const @@ -1242,7 +1242,7 @@ void LineAnnotPainter::drawLineEndSlash(double xEndPos, double size, const QTran {xEndPos - xOffset, halfSize}, {xEndPos + xOffset, -halfSize}, }; - PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), true, linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), true, linePen, fillBrush, pageScale); } void LineAnnotPainter::drawLeaderLine(double xEndPos, QImage &image, const QTransform &toNormalizedPage) const @@ -1262,7 +1262,7 @@ void LineAnnotPainter::drawLeaderLine(double xEndPos, QImage &image, const QTran path.append({xEndPos, 0}); } } - PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), false, linePen, fillBrush, pageScale, PagePainter::Multiply); + PagePainter::drawShapeOnImage(image, transformPath(path, combinedTransform), false, linePen, fillBrush, pageScale); } double LineAnnotPainter::shortenForArrow(double size, Okular::LineAnnotation::TermStyle endStyle) diff --git a/ui/pagepainter.h b/ui/pagepainter.h index 6ee868d5a..58bfd0564 100644 --- a/ui/pagepainter.h +++ b/ui/pagepainter.h @@ -91,7 +91,7 @@ private: static void drawShapeOnImage(QImage &image, const NormalizedPath &normPath, bool closeShape, const QPen &pen, const QBrush &brush = QBrush(), double penWidthMultiplier = 1.0, RasterOperation op = Normal // float antiAliasRadius = 1.0 ); - static void drawEllipseOnImage(QImage &image, const NormalizedPath &rect, const QPen &pen, const QBrush &brush, double penWidthMultiplier, RasterOperation op); + static void drawEllipseOnImage(QImage &image, const NormalizedPath &rect, const QPen &pen, const QBrush &brush, double penWidthMultiplier, RasterOperation op = Normal); friend class LineAnnotPainter; };