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 <gabriel.dedietrich@digia.com>
Reviewed-by: Steve Mokris <smokris@softpixel.com>
This commit is contained in:
Morten Johan Sørvig 2014-03-24 10:10:50 +01:00 committed by The Qt Project
parent b11adb825c
commit d6202762c1

View File

@ -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);
}