Skip to content

Commit

Permalink
Fixed copy not taking selected area instead of full image
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanC committed Feb 13, 2019
1 parent 7c2c652 commit 245f7e3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,10 @@ void MainWindow::onCopy()
if (widget)
{
QClipboard *clipboard = QApplication::clipboard();
clipboard->setImage(widget->image());
QImage cpy = widget->selection().isEmpty()
? widget->image()
: widget->image().copy(widget->selection().boundingRect());
clipboard->setImage(cpy);
}
}

Expand Down

0 comments on commit 245f7e3

Please sign in to comment.