Skip to content

Commit

Permalink
Fix image position for selecting screenshot area
Browse files Browse the repository at this point in the history
  • Loading branch information
hluk committed Jun 17, 2017
1 parent cb2819b commit 2ba9fc2
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/scriptable/scriptableproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,7 @@ class ScreenshotRectWidget : public QLabel {
{
setWindowFlags(Qt::Widget | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
setCursor(Qt::CrossCursor);

move(0, 0);
resize(pixmap.size());
setPixmap(pixmap);

show();
}

void paintEvent(QPaintEvent *ev) override
Expand Down Expand Up @@ -1242,6 +1237,9 @@ QByteArray ScriptableProxy::screenshot(const QString &format, const QString &scr

if (select) {
ScreenshotRectWidget rectWidget(pixmap);
rectWidget.setGeometry( selectedScreen->geometry() );
rectWidget.show();

while ( !rectWidget.isHidden() )
QCoreApplication::processEvents();
const auto rect = rectWidget.selectionRect;
Expand Down

0 comments on commit 2ba9fc2

Please sign in to comment.