Cursor support

This commit is contained in:
ArsenArsen 2017-05-13 23:39:38 +02:00
parent 927e7c4165
commit 446440aca9

View File

@ -10,10 +10,11 @@
QPixmap *screenshotutil::fullscreen() { QPixmap *screenshotutil::fullscreen() {
QPixmap *noCursor = window(0); QPixmap *noCursor = window(0);
QScopedPointer<QPixmap> p(noCursor); QScopedPointer<QPixmap> p(noCursor);
QPixmap *withCursor = new QPixmap(noCursor->size()); QPixmap *withCursor = new QPixmap(*noCursor);
QPainter painter(withCursor); QPainter painter(withCursor);
auto cursorData = PlatformBackend::inst().getCursor(); auto cursorData = PlatformBackend::inst().getCursor();
painter.drawPixmap(std::get<0>(cursorData), std::get<1>(cursorData)); painter.drawPixmap(QCursor::pos() - std::get<0>(cursorData), std::get<1>(cursorData));
painter.end();
return withCursor; return withCursor;
} }