|
|
@ -120,8 +120,12 @@ void UBGraphicsItemUndoCommand::undo() |
|
|
|
{ |
|
|
|
{ |
|
|
|
UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item); |
|
|
|
UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item); |
|
|
|
if (polygonItem) |
|
|
|
if (polygonItem) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mScene->removeItem(polygonItem); |
|
|
|
|
|
|
|
mScene->removeItemFromDeletion(polygonItem); |
|
|
|
polygonItem->strokesGroup()->addToGroup(polygonItem); |
|
|
|
polygonItem->strokesGroup()->addToGroup(polygonItem); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBApplication::boardController->freezeW3CWidget(item, false); |
|
|
|
UBApplication::boardController->freezeW3CWidget(item, false); |
|
|
|
} |
|
|
|
} |
|
|
@ -225,9 +229,13 @@ void UBGraphicsItemUndoCommand::redo() |
|
|
|
|
|
|
|
|
|
|
|
UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item); |
|
|
|
UBGraphicsPolygonItem *polygonItem = qgraphicsitem_cast<UBGraphicsPolygonItem*>(item); |
|
|
|
if (polygonItem) |
|
|
|
if (polygonItem) |
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mScene->removeItem(polygonItem); |
|
|
|
|
|
|
|
mScene->removeItemFromDeletion(polygonItem); |
|
|
|
polygonItem->strokesGroup()->addToGroup(polygonItem); |
|
|
|
polygonItem->strokesGroup()->addToGroup(polygonItem); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2) to trigger repaint
|
|
|
|
// force refresh, QT is a bit lazy and take a lot of time (nb item ^2) to trigger repaint
|
|
|
|
mScene->update(mScene->sceneRect()); |
|
|
|
mScene->update(mScene->sceneRect()); |
|
|
|