Round the image scaling when not antialiased
When painting an image with antialiasing not turned on, round the target area to closest integers (pixels). Task-number: QTBUG-116297 Pick-to: 6.6 Change-Id: I64e78a9087ee042aef0ea297c48b5ead36697d10 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
This commit is contained in:
parent
104a0a9ecd
commit
743c1cf96b
@ -2342,9 +2342,16 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
|
||||
}
|
||||
SrcOverScaleFunc func = qScaleFunctions[d->rasterBuffer->format][img.format()];
|
||||
if (func && (!clip || clip->hasRectClip)) {
|
||||
QRectF tr = qt_mapRect_non_normalizing(r, s->matrix);
|
||||
if (!s->flags.antialiased) {
|
||||
tr.setX(qRound(tr.x()));
|
||||
tr.setY(qRound(tr.y()));
|
||||
tr.setWidth(qRound(tr.width()));
|
||||
tr.setHeight(qRound(tr.height()));
|
||||
}
|
||||
func(d->rasterBuffer->buffer(), d->rasterBuffer->bytesPerLine(),
|
||||
img.bits(), img.bytesPerLine(), img.height(),
|
||||
qt_mapRect_non_normalizing(r, s->matrix), sr,
|
||||
tr, sr,
|
||||
!clip ? d->deviceRect : clip->clipRect,
|
||||
s->intOpacity);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user