diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 00765fbc..72e5dd1c 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -638,11 +638,11 @@ QRectF UBLibraryController::visibleSceneRect() void UBLibraryController::addImagesToCurrentPage(const QList& images) { - QPointF pos = visibleSceneRect().center(); + QPointF pos = UBApplication::boardController->activeScene()->normalizedSceneRect().center(); + foreach(const QUrl url, images) { - mLastItemOffsetIndex++; mLastItemOffsetIndex = qMin(mLastItemOffsetIndex, 5); QGraphicsItem* itemInScene = 0; @@ -651,6 +651,8 @@ void UBLibraryController::addImagesToCurrentPage(const QList& images) QString mimeType = UBFileSystemUtils::mimeTypeFromFileName( url.toString()); + pos = QPointF(pos.x() + 50 * mLastItemOffsetIndex, pos.y() + 50 * mLastItemOffsetIndex); + mLastItemOffsetIndex++; //TODO UB 4.x move this logic to the scene .. if (mimeType == "image/svg+xml") { itemInScene = activeScene()->addSvg(url, pos); @@ -662,8 +664,6 @@ void UBLibraryController::addImagesToCurrentPage(const QList& images) if (itemInScene) { itemInScene = activeScene()->scaleToFitDocumentSize(itemInScene, false, UBSettings::objectInControlViewMargin); - - itemInScene->setPos(QPoint(pos.x() + 50 * mLastItemOffsetIndex, pos.y() + 50 * mLastItemOffsetIndex)); } } }