Commit 8f89afbd authored by Claudio Valerio's avatar Claudio Valerio

fixed issue of images imported on document mode with the import button

parent 9df8c0f8
......@@ -108,7 +108,7 @@ void UBImportImage::placeImportedItemToScene(UBGraphicsScene* scene, UBGraphicsI
{
UBGraphicsPixmapItem* pixmapItem = (UBGraphicsPixmapItem*)item;
UBGraphicsPixmapItem* sceneItem = scene->addPixmap(pixmapItem->pixmap(), NULL, QPointF(0, 0));
UBGraphicsPixmapItem* sceneItem = scene->addPixmap(pixmapItem->pixmap(), NULL, QPointF(0, 0),1.0,false,true);
scene->setAsBackgroundObject(sceneItem, true);
// Only stored pixmap, should be deleted now
......
......@@ -1245,7 +1245,7 @@ void UBGraphicsScene::clearContent(clearCase pCase)
setDocumentUpdated();
}
UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphicsItem* replaceFor, const QPointF& pPos, qreal pScaleFactor, bool pUseAnimation)
UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphicsItem* replaceFor, const QPointF& pPos, qreal pScaleFactor, bool pUseAnimation, bool useProxyForDocumentPath)
{
UBGraphicsPixmapItem* pixmapItem = new UBGraphicsPixmapItem();
......@@ -1281,7 +1281,11 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphi
pixmapItem->show();
setDocumentUpdated();
QString documentPath = UBApplication::boardController->selectedDocument()->persistencePath();
QString documentPath;
if(useProxyForDocumentPath)
documentPath = this->document()->persistencePath();
else
documentPath = UBApplication::boardController->selectedDocument()->persistencePath();
QString fileName = UBPersistenceManager::imageDirectory + "/" + pixmapItem->uuid().toString() + ".png";
......
......@@ -334,7 +334,8 @@ public slots:
QGraphicsItem* replaceFor,
const QPointF& pPos = QPointF(0,0),
qreal scaleFactor = 1.0,
bool pUseAnimation = false);
bool pUseAnimation = false,
bool useProxyForDocumentPath = false);
void textUndoCommandAdded(UBGraphicsTextItem *textItem);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment