Skip to content

Commit

Permalink
Merge pull request #8 from seequent/LF-36223-grey-lines-in-project-tree
Browse files Browse the repository at this point in the history
LF-36223 Fix rounding error within QBackingStore
  • Loading branch information
BenLewis-Seequent authored May 4, 2021
2 parents d6d25b1 + 6aba8d2 commit aefd71c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/gui/painting/qbackingstore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,11 @@ void QBackingStore::flush(const QRegion &region, QWindow *window, const QPoint &

Q_ASSERT(window == topLevelWindow || topLevelWindow->isAncestorOf(window, QWindow::ExcludeTransients));

handle()->flush(window, QHighDpi::toNativeLocalRegion(region, window),
QHighDpi::toNativeLocalPosition(offset, window));
// Scale the region relative to the top level window, so it avoids rounding errors when both
// offset and region would round up if scaled independently.
QPoint nativeOffset = QHighDpi::toNativeLocalPosition(offset, window);
QRegion nativeRegion = QHighDpi::toNativeLocalRegion(region.translated(offset), window);
handle()->flush(window, nativeRegion.translated(-nativeOffset), nativeOffset);
}

/*!
Expand Down

0 comments on commit aefd71c

Please sign in to comment.