Mac: More accurate focus mask

Small artifacts were visible when tabing in and out QLineEdits several times.

Change-Id: I56334e0534c67c94d357e3517d2470adcc1d8a1c
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2012-11-09 15:41:08 +01:00 committed by The Qt Project
parent d91c1422a9
commit e5eeffbf8b

View File

@ -2585,10 +2585,11 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
srow = sptr+((y*sbpl)/4);
drow = dptr+((y*dbpl)/4);
for (int x = 0; x < w; ++x) {
const int diff = (((qRed(*srow)-fillR)*(qRed(*srow)-fillR)) +
((qGreen(*srow)-fillG)*((qGreen(*srow)-fillG))) +
((qBlue(*srow)-fillB)*((qBlue(*srow)-fillB))));
(*drow++) = (diff < 100) ? 0xffffffff : 0xff000000;
const int redDiff = qRed(*srow) - fillR;
const int greenDiff = qGreen(*srow) - fillG;
const int blueDiff = qBlue(*srow) - fillB;
const int diff = (redDiff * redDiff) + (greenDiff * greenDiff) + (blueDiff * blueDiff);
(*drow++) = (diff < 10) ? 0xffffffff : 0xff000000;
++srow;
}
}