Fix undo issue primarily with libedit.

Fixes: lp:1797900
* https://bugs.launchpad.net/kicad/+bug/1797900
This commit is contained in:
Jeff Young 2018-10-17 13:09:58 +01:00
parent 254e9f4a7e
commit c22a247dbc
2 changed files with 7 additions and 6 deletions

View File

@ -148,18 +148,21 @@ void BLOCK_SELECTOR::InitData( EDA_DRAW_PANEL* aPanel, const wxPoint& startpos )
void BLOCK_SELECTOR::ClearItemsList()
{
m_items.ClearItemsList();
m_appendUndo = false;
}
void BLOCK_SELECTOR::ClearListAndDeleteItems()
{
m_items.ClearListAndDeleteItems();
m_appendUndo = false;
}
void BLOCK_SELECTOR::PushItem( ITEM_PICKER& aItem )
{
m_items.PushItem( aItem );
m_appendUndo = false;
}

View File

@ -440,30 +440,28 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
case BLOCK_DRAG_ITEM:
case BLOCK_MOVE: // Move
case BLOCK_DUPLICATE: // Duplicate
block->ClearItemsList();
if( GetCurPart() && !block->AppendUndo() )
SaveCopyInUndoList( GetCurPart() );
pt = block->GetMoveVector();
//pt.y *= -1;
if( GetCurPart() )
BlockMoveSelectedItems( pt, GetCurPart(), block );
block->ClearItemsList();
m_canvas->Refresh( true );
break;
case BLOCK_PASTE: // Paste (recopy the last block saved)
block->ClearItemsList();
if( GetCurPart() )
SaveCopyInUndoList( GetCurPart() );
pt = block->GetMoveVector();
//pt.y = -pt.y;
pasteClipboard( pt );
block->ClearItemsList();
m_canvas->Refresh( true );
break;
case BLOCK_ZOOM: // Handled by HandleBlockEnd