diff --git a/cropeditor/cropscene.cpp b/cropeditor/cropscene.cpp index bd71c72..c63de90 100644 --- a/cropeditor/cropscene.cpp +++ b/cropeditor/cropscene.cpp @@ -1,4 +1,5 @@ #include "cropscene.hpp" +#include #include #include #include @@ -8,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -145,11 +147,13 @@ CropScene::CropScene(QObject *parent, QPixmap pixmap) widget->setPos(100, 100); proxyMenu = widget; - QTimer::singleShot(0, [&] { + QTimer::singleShot(0, [&, widget] { auto pf = views()[0]->mapFromGlobal(QCursor::pos()); cursorPos = QPoint(pf.x(), pf.y()); cursorItem->setPos(cursorPos); updateMag(); + int w = QApplication::primaryScreen()->geometry().width(); + widget->setPos((w - widget->boundingRect().width()) / 2, 100); }); }