From 5020d1b22a31f5fe45287547037c57fa5aeb06d7 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Tue, 3 May 2022 15:16:05 +0200 Subject: [PATCH] Avoid rubberband artifacts under fractional DPR scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Expand the rubberband repaint area with one pixel to account for rounding on screens with fractional device pixel ratio. Fixes: QTBUG-102717 Pick-to: 6.3 6.2 Change-Id: Iede638d48dfbc3156b02ada28dfe99719b9d5efa Reviewed-by: Morten Johan Sørvig --- src/widgets/graphicsview/qgraphicsview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/graphicsview/qgraphicsview.cpp b/src/widgets/graphicsview/qgraphicsview.cpp index e47c214ec68..c24a73eb1ff 100644 --- a/src/widgets/graphicsview/qgraphicsview.cpp +++ b/src/widgets/graphicsview/qgraphicsview.cpp @@ -732,7 +732,7 @@ QRegion QGraphicsViewPrivate::rubberBandRegion(const QWidget *widget, const QRec option.shape = QRubberBand::Rectangle; QRegion tmp; - tmp += rect; + tmp += rect.adjusted(-1, -1, 1, 1); if (widget->style()->styleHint(QStyle::SH_RubberBand_Mask, &option, widget, &mask)) tmp &= mask.region; return tmp;