From d6202762c135fbf5f1242911cf2455ff687f328e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 24 Mar 2014 10:10:50 +0100 Subject: OS X: Fix QRubberBand drawing on retina displays Extend the existing rect adjustment to cover the upper/left edges as well. Check for a valid rect before drawing. Task-number: QTBUG-34534 Change-Id: I156abf4fb52924c350ec24fb44eadca86b2d5339 Reviewed-by: Gabriel de Dietrich Reviewed-by: Steve Mokris --- src/widgets/styles/qmacstyle_mac.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 55e808e9ba..08221ce83a 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -4414,7 +4414,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter QPen pen(strokeColor); p->setPen(pen); p->setBrush(fillColor); - p->drawRect(opt->rect.adjusted(0, 0, -1, -1)); + QRect adjusted = opt->rect.adjusted(1, 1, -1, -1); + if (adjusted.isValid()) + p->drawRect(adjusted); p->setPen(oldPen); p->setBrush(oldBrush); } -- cgit v1.2.3