macOS: Make QScreen::grabWindow() work again

Commit 17b73b0d2b introduced a regression where the
grab rect position was added to the size when bounding
to the display size. This is incorrect.

Change-Id: I11d7ba7f53b96badfdead190ef9ddb525ed4ba99
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Morten Johan Sørvig 2018-09-25 12:54:09 +02:00 committed by Liang Qi
parent ae5f440c33
commit 98c789eb0f
1 changed files with 2 additions and 2 deletions

View File

@ -474,8 +474,8 @@ QPixmap QCocoaScreen::grabWindow(WId window, int x, int y, int width, int height
// Calculate the position and size of the requested area
QPoint pos(qAbs(bounds.origin.x - x), qAbs(bounds.origin.y - y));
QSize size(qMin(pos.x() + width, qRound(bounds.size.width)),
qMin(pos.y() + height, qRound(bounds.size.height)));
QSize size(qMin(width, qRound(bounds.size.width)),
qMin(height, qRound(bounds.size.height)));
pos *= dpr;
size *= dpr;