Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.

Commit

Permalink
fix(blur): check geometry failed
Browse files Browse the repository at this point in the history
  • Loading branch information
justforlxz committed May 21, 2019
1 parent 3c1fef4 commit f0a8228
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ QPixmap MainWindow::getPixmapofRect(const QRect &rect)

QList<QScreen*> screenList = qApp->screens();
for (auto it = screenList.constBegin(); it != screenList.constEnd(); ++it) {
if (r == (*it)->geometry()) {
if ((*it)->geometry().contains(r)) {
return (*it)->grabWindow(m_swUtil->rootWindowId(), rect.x(), rect.y(), rect.width(), rect.height());
}
}
Expand Down Expand Up @@ -1206,7 +1206,9 @@ void MainWindow::shotImgWidthEffect()
// eventloop.exec();

qDebug() << m_toolBar->isVisible() << m_sizeTips->isVisible();
m_resultPixmap = getPixmapofRect(m_shapesWidget->geometry());
const qreal ratio = devicePixelRatioF();
const QRect rect(m_shapesWidget->geometry().topLeft() * ratio, m_shapesWidget->geometry().size() * ratio);
m_resultPixmap = m_backgroundPixmap.copy(rect);
m_drawNothing = false;
update();
}
Expand Down

0 comments on commit f0a8228

Please # to comment.