From ea82bfb5324e58ceb2eee132a6030c32a1e2916b Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete Date: Fri, 22 Aug 2014 15:13:28 +0200 Subject: [PATCH] Painting fix when devicePixelRatio > 1 Qt draws lines on half-pixel boundaries. Because of rounding, this is not visible with non-scaled aliased painting. However, on a high-DPI screen with scaling enabled, the line under the menu bar is drawn at a one pixel offset, which causes it to overlap the menubar items. This change draws the line at the mathematically correct position. Task-number: QTBUG-38858 Change-Id: I0a2260507d346b52a36258d479cde87064d991ef Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/manhattanstyle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 90789dc0ff8..f1b8e68500b 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -778,7 +778,8 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt Utils::StyleHelper::menuGradient(painter, option->rect, option->rect); painter->save(); painter->setPen(Utils::StyleHelper::borderColor()); - painter->drawLine(option->rect.bottomLeft(), option->rect.bottomRight()); + painter->drawLine(option->rect.bottomLeft() + QPointF(0.5, 0.5), + option->rect.bottomRight() + QPointF(0.5, 0.5)); painter->restore(); } break;