From c6b3f4b28200a2f1a4af70cc30af91b74a6df64b Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 5 Jun 2018 15:12:57 +0200 Subject: [PATCH] Fix black border around main widget with non-integer scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All the other highdpi scaling uses rounding, and not using it here may offset the compositing by a line. Task-number: QTBUG-67994 Change-Id: I2f5f328c091d0e85c40b1663e22c82f364df65e5 Reviewed-by: Morten Johan Sørvig --- src/gui/painting/qplatformbackingstore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp index 09c23fdfa1c..cc8d850689a 100644 --- a/src/gui/painting/qplatformbackingstore.cpp +++ b/src/gui/painting/qplatformbackingstore.cpp @@ -344,7 +344,7 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion ®i QWindowPrivate::get(window)->lastComposeTime.start(); QOpenGLFunctions *funcs = d_ptr->context->functions(); - funcs->glViewport(0, 0, window->width() * window->devicePixelRatio(), window->height() * window->devicePixelRatio()); + funcs->glViewport(0, 0, qRound(window->width() * window->devicePixelRatio()), qRound(window->height() * window->devicePixelRatio())); funcs->glClearColor(0, 0, 0, translucentBackground ? 0 : 1); funcs->glClear(GL_COLOR_BUFFER_BIT);