Cleanup undo/redo
Mirror/Rotate/etc were all just "Change" items in the undo/redo stack. This removes the old calls
This commit is contained in:
parent
be6683b8b7
commit
d244c09680
|
@ -214,12 +214,6 @@ CHANGE_TYPE COMMIT::convert( UNDO_REDO aType ) const
|
|||
// fall through
|
||||
|
||||
case UNDO_REDO::CHANGED:
|
||||
case UNDO_REDO::MOVED:
|
||||
case UNDO_REDO::MIRRORED_X:
|
||||
case UNDO_REDO::MIRRORED_Y:
|
||||
case UNDO_REDO::ROTATED:
|
||||
case UNDO_REDO::ROTATED_CLOCKWISE:
|
||||
case UNDO_REDO::FLIPPED:
|
||||
return CHT_MODIFY;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -764,7 +764,6 @@ public:
|
|||
* NEWITEM
|
||||
* DELETED
|
||||
* UR_WIRE_IMAGE
|
||||
* MOVED
|
||||
*
|
||||
* If it is a delete command, items are put on list with the .Flags member
|
||||
* set to DELETED.
|
||||
|
|
|
@ -129,8 +129,6 @@ void SCH_EDIT_FRAME::SaveCopyInUndoList( SCH_SCREEN* aScreen,
|
|||
|
||||
case UNDO_REDO::NEWITEM:
|
||||
case UNDO_REDO::DELETED:
|
||||
case UNDO_REDO::ROTATED:
|
||||
case UNDO_REDO::MOVED:
|
||||
commandToUndo->PushItem( itemWrapper );
|
||||
break;
|
||||
|
||||
|
@ -220,10 +218,6 @@ void SCH_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsList,
|
|||
wxASSERT( commandToUndo->GetPickedItemLink( ii ) );
|
||||
break;
|
||||
|
||||
case UNDO_REDO::MOVED:
|
||||
case UNDO_REDO::MIRRORED_Y:
|
||||
case UNDO_REDO::MIRRORED_X:
|
||||
case UNDO_REDO::ROTATED:
|
||||
case UNDO_REDO::NEWITEM:
|
||||
case UNDO_REDO::DELETED:
|
||||
case UNDO_REDO::EXCHANGE_T:
|
||||
|
@ -306,30 +300,6 @@ void SCH_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool aRed
|
|||
|
||||
break;
|
||||
|
||||
case UNDO_REDO::MOVED:
|
||||
item->Move( aRedoCommand ? aList->m_TransformPoint : -aList->m_TransformPoint );
|
||||
break;
|
||||
|
||||
case UNDO_REDO::MIRRORED_Y:
|
||||
item->MirrorY( aList->m_TransformPoint.x );
|
||||
break;
|
||||
|
||||
case UNDO_REDO::MIRRORED_X:
|
||||
item->MirrorX( aList->m_TransformPoint.y );
|
||||
break;
|
||||
|
||||
case UNDO_REDO::ROTATED:
|
||||
if( aRedoCommand )
|
||||
item->Rotate( aList->m_TransformPoint );
|
||||
else
|
||||
{
|
||||
// Rotate 270 deg to undo 90-deg rotate
|
||||
item->Rotate( aList->m_TransformPoint );
|
||||
item->Rotate( aList->m_TransformPoint );
|
||||
item->Rotate( aList->m_TransformPoint );
|
||||
}
|
||||
break;
|
||||
|
||||
case UNDO_REDO::EXCHANGE_T:
|
||||
aList->SetPickedItem( alt_item, (unsigned) ii );
|
||||
aList->SetPickedItemLink( item, (unsigned) ii );
|
||||
|
|
|
@ -58,12 +58,6 @@ enum class UNDO_REDO {
|
|||
// values with a copy of these values
|
||||
NEWITEM, // new item, undo by changing in deleted
|
||||
DELETED, // deleted item, undo by changing in deleted
|
||||
MOVED, // moved item, undo by move it
|
||||
MIRRORED_X, // mirrored item, undo by mirror X
|
||||
MIRRORED_Y, // mirrored item, undo by mirror Y
|
||||
ROTATED, // Rotated item (counterclockwise), undo by rotating it
|
||||
ROTATED_CLOCKWISE, // Rotated item (clockwise), undo by rotating it
|
||||
FLIPPED, // flipped (board items only), undo by flipping it
|
||||
LIBEDIT, // Specific to the component editor (symbol_editor creates a full copy
|
||||
// of the current component when changed)
|
||||
LIB_RENAME, // As LIBEDIT, but old copy should be removed from library
|
||||
|
|
|
@ -284,10 +284,6 @@ void PCB_BASE_EDIT_FRAME::SaveCopyInUndoList( const PICKED_ITEMS_LIST& aItemsLis
|
|||
}
|
||||
break;
|
||||
|
||||
case UNDO_REDO::MOVED:
|
||||
case UNDO_REDO::ROTATED:
|
||||
case UNDO_REDO::ROTATED_CLOCKWISE:
|
||||
case UNDO_REDO::FLIPPED:
|
||||
case UNDO_REDO::NEWITEM:
|
||||
case UNDO_REDO::DELETED:
|
||||
case UNDO_REDO::PAGESETTINGS:
|
||||
|
@ -508,48 +504,6 @@ void PCB_BASE_EDIT_FRAME::PutDataInPreviousState( PICKED_ITEMS_LIST* aList, bool
|
|||
|
||||
break;
|
||||
|
||||
case UNDO_REDO::MOVED:
|
||||
{
|
||||
BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
|
||||
item->Move( aRedoCommand ? aList->m_TransformPoint : -aList->m_TransformPoint );
|
||||
view->Update( item, KIGFX::GEOMETRY );
|
||||
connectivity->Update( item );
|
||||
item->GetBoard()->OnItemChanged( item );
|
||||
}
|
||||
break;
|
||||
|
||||
case UNDO_REDO::ROTATED:
|
||||
{
|
||||
BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
|
||||
item->Rotate( aList->m_TransformPoint,
|
||||
aRedoCommand ? m_rotationAngle : -m_rotationAngle );
|
||||
view->Update( item, KIGFX::GEOMETRY );
|
||||
connectivity->Update( item );
|
||||
item->GetBoard()->OnItemChanged( item );
|
||||
}
|
||||
break;
|
||||
|
||||
case UNDO_REDO::ROTATED_CLOCKWISE:
|
||||
{
|
||||
BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
|
||||
item->Rotate( aList->m_TransformPoint,
|
||||
aRedoCommand ? -m_rotationAngle : m_rotationAngle );
|
||||
view->Update( item, KIGFX::GEOMETRY );
|
||||
connectivity->Update( item );
|
||||
item->GetBoard()->OnItemChanged( item );
|
||||
}
|
||||
break;
|
||||
|
||||
case UNDO_REDO::FLIPPED:
|
||||
{
|
||||
BOARD_ITEM* item = (BOARD_ITEM*) eda_item;
|
||||
item->Flip( aList->m_TransformPoint, m_settings->m_FlipLeftRight );
|
||||
view->Update( item, KIGFX::LAYERS );
|
||||
connectivity->Update( item );
|
||||
item->GetBoard()->OnItemChanged( item );
|
||||
}
|
||||
break;
|
||||
|
||||
case UNDO_REDO::DRILLORIGIN:
|
||||
case UNDO_REDO::GRIDORIGIN:
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue