From 446440aca9b2c9f4967d41eaad4372102016a2d2 Mon Sep 17 00:00:00 2001 From: ArsenArsen Date: Sat, 13 May 2017 23:39:38 +0200 Subject: [PATCH] Cursor support --- screenshotutil.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/screenshotutil.cpp b/screenshotutil.cpp index 85c821e..8e5b1db 100644 --- a/screenshotutil.cpp +++ b/screenshotutil.cpp @@ -10,10 +10,11 @@ QPixmap *screenshotutil::fullscreen() { QPixmap *noCursor = window(0); QScopedPointer p(noCursor); - QPixmap *withCursor = new QPixmap(noCursor->size()); + QPixmap *withCursor = new QPixmap(*noCursor); QPainter painter(withCursor); 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; }