When add a background image place it at the center of visible area.

This commit is contained in:
Roman Telezhynskyi 2022-02-04 11:30:50 +02:00
parent fd8d2f8a9d
commit 10a2de6b1d

View file

@ -3687,7 +3687,8 @@ void MainWindow::ActionAddBackgroundImage()
VAbstractApplication::VApp()->NativeFileDialog());
if (not fileName.isEmpty())
{
PlaceBackgroundImage(QPointF(), fileName);
QRect viewportRect(0, 0, ui->view->viewport()->width(), ui->view->viewport()->height());
PlaceBackgroundImage(ui->view->mapToScene(viewportRect.center()), fileName);
}
}