Fixes --region to respect display scaling (#2788)

This commit is contained in:
wd5gnr
2022-07-17 10:23:25 -05:00
committed by GitHub
parent fa6164bedf
commit caf90215b4

View File

@@ -1194,8 +1194,13 @@ void CaptureWidget::initSelection()
}
});
if (!initialSelection.isNull()) {
const qreal scale = m_context.screenshot.devicePixelRatio();
initialSelection.moveTopLeft(initialSelection.topLeft() -
mapToGlobal({}));
initialSelection.setTop(initialSelection.top() / scale);
initialSelection.setBottom(initialSelection.bottom() / scale);
initialSelection.setLeft(initialSelection.left() / scale);
initialSelection.setRight(initialSelection.right() / scale);
}
m_selection->setGeometry(initialSelection);
m_selection->setVisible(!initialSelection.isNull());