From 10a2de6b1db68d8e6841db194ba61aa81370fd9d Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Fri, 4 Feb 2022 11:30:50 +0200 Subject: [PATCH] When add a background image place it at the center of visible area. --- src/app/valentina/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/valentina/mainwindow.cpp b/src/app/valentina/mainwindow.cpp index 461d9aa0e..041517803 100644 --- a/src/app/valentina/mainwindow.cpp +++ b/src/app/valentina/mainwindow.cpp @@ -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); } }