forked from qt-creator/qt-creator
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 <alessandro.portale@digia.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user