Commit ea82bfb5 authored by Paul Olav Tvete's avatar Paul Olav Tvete

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: default avatarAlessandro Portale <alessandro.portale@digia.com>
parent 9f2d54c9
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment