fixed an issue where a copy of an item registered as a tool would not be registered itself as is

preferencesAboutTextFull
Clément Fauconnier 3 years ago
parent b401d49176
commit 19fd765ac3
  1. 8
      src/board/UBBoardController.cpp

@ -732,11 +732,19 @@ UBGraphicsItem *UBBoardController::duplicateItem(UBItem *item)
case UBMimeType::UNKNOWN: case UBMimeType::UNKNOWN:
{ {
QGraphicsItem *copiedItem = dynamic_cast<QGraphicsItem*>(item);
QGraphicsItem *gitem = dynamic_cast<QGraphicsItem*>(item->deepCopy()); QGraphicsItem *gitem = dynamic_cast<QGraphicsItem*>(item->deepCopy());
if (gitem) if (gitem)
{ {
mActiveScene->addItem(gitem); mActiveScene->addItem(gitem);
if (copiedItem)
{
if (mActiveScene->tools().contains(copiedItem))
{
mActiveScene->registerTool(gitem);
}
}
gitem->setPos(itemPos); gitem->setPos(itemPos);
mLastCreatedItem = gitem; mLastCreatedItem = gitem;

Loading…
Cancel
Save