diff options
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qpaintengine_raster.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index c166c52..93282ab 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -1762,10 +1762,10 @@ void QRasterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) static inline QRect toNormalizedFillRect(const QRectF &rect) { - const int x1 = qRound(rect.x() + aliasedCoordinateDelta); - const int y1 = qRound(rect.y() + aliasedCoordinateDelta); - const int x2 = qRound(rect.right() + aliasedCoordinateDelta); - const int y2 = qRound(rect.bottom() + aliasedCoordinateDelta); + const int x1 = qRound(rect.x()); + const int y1 = qRound(rect.y()); + const int x2 = qRound(rect.right()); + const int y2 = qRound(rect.bottom()); return QRect(x1, y1, x2 - x1, y2 - y1).normalized(); } @@ -1797,8 +1797,9 @@ void QRasterPaintEngine::fill(const QVectorPath &path, const QBrush &brush) if (path.shape() == QVectorPath::RectangleHint) { if (!s->flags.antialiased && s->matrix.type() <= QTransform::TxScale) { const qreal *p = path.points(); - QPointF tl = QPointF(p[0], p[1]) * s->matrix; - QPointF br = QPointF(p[4], p[5]) * s->matrix; + const QPointF offs(aliasedCoordinateDelta, aliasedCoordinateDelta); + QPointF tl = QPointF(p[0], p[1]) * s->matrix + offs; + QPointF br = QPointF(p[4], p[5]) * s->matrix + offs; fillRect_normalized(toNormalizedFillRect(QRectF(tl, br)), &s->brushData, d); return; } @@ -2597,12 +2598,7 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe QRasterPaintEngineState *s = state(); const bool aa = s->flags.antialiased || s->flags.bilinear; if (!aa && sr.size() == QSize(1, 1)) { - // as fillRect will apply the aliased coordinate delta we need to - // subtract it here as we don't use it for image drawing - QTransform old = s->matrix; - s->matrix = s->matrix * QTransform::fromTranslate(-aliasedCoordinateDelta, -aliasedCoordinateDelta); fillRect(r, QColor::fromRgba(img.pixel(sr.x(), sr.y()))); - s->matrix = old; return; } |