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

preferencesAboutTextFull
Claudio Valerio 10 years ago
parent 9df8c0f823
commit 8f89afbd54
  1. 2
      src/adaptors/UBImportImage.cpp
  2. 8
      src/domain/UBGraphicsScene.cpp
  3. 3
      src/domain/UBGraphicsScene.h

@ -108,7 +108,7 @@ void UBImportImage::placeImportedItemToScene(UBGraphicsScene* scene, UBGraphicsI
{ {
UBGraphicsPixmapItem* pixmapItem = (UBGraphicsPixmapItem*)item; 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); scene->setAsBackgroundObject(sceneItem, true);
// Only stored pixmap, should be deleted now // Only stored pixmap, should be deleted now

@ -1245,7 +1245,7 @@ void UBGraphicsScene::clearContent(clearCase pCase)
setDocumentUpdated(); 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(); UBGraphicsPixmapItem* pixmapItem = new UBGraphicsPixmapItem();
@ -1281,7 +1281,11 @@ UBGraphicsPixmapItem* UBGraphicsScene::addPixmap(const QPixmap& pPixmap, QGraphi
pixmapItem->show(); pixmapItem->show();
setDocumentUpdated(); 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"; QString fileName = UBPersistenceManager::imageDirectory + "/" + pixmapItem->uuid().toString() + ".png";

@ -334,7 +334,8 @@ public slots:
QGraphicsItem* replaceFor, QGraphicsItem* replaceFor,
const QPointF& pPos = QPointF(0,0), const QPointF& pPos = QPointF(0,0),
qreal scaleFactor = 1.0, qreal scaleFactor = 1.0,
bool pUseAnimation = false); bool pUseAnimation = false,
bool useProxyForDocumentPath = false);
void textUndoCommandAdded(UBGraphicsTextItem *textItem); void textUndoCommandAdded(UBGraphicsTextItem *textItem);

Loading…
Cancel
Save