Fix undo issue primarily with libedit.
Fixes: lp:1797900 * https://bugs.launchpad.net/kicad/+bug/1797900
This commit is contained in:
parent
254e9f4a7e
commit
c22a247dbc
|
@ -148,18 +148,21 @@ void BLOCK_SELECTOR::InitData( EDA_DRAW_PANEL* aPanel, const wxPoint& startpos )
|
||||||
void BLOCK_SELECTOR::ClearItemsList()
|
void BLOCK_SELECTOR::ClearItemsList()
|
||||||
{
|
{
|
||||||
m_items.ClearItemsList();
|
m_items.ClearItemsList();
|
||||||
|
m_appendUndo = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BLOCK_SELECTOR::ClearListAndDeleteItems()
|
void BLOCK_SELECTOR::ClearListAndDeleteItems()
|
||||||
{
|
{
|
||||||
m_items.ClearListAndDeleteItems();
|
m_items.ClearListAndDeleteItems();
|
||||||
|
m_appendUndo = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BLOCK_SELECTOR::PushItem( ITEM_PICKER& aItem )
|
void BLOCK_SELECTOR::PushItem( ITEM_PICKER& aItem )
|
||||||
{
|
{
|
||||||
m_items.PushItem( aItem );
|
m_items.PushItem( aItem );
|
||||||
|
m_appendUndo = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -440,30 +440,28 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
|
||||||
case BLOCK_DRAG_ITEM:
|
case BLOCK_DRAG_ITEM:
|
||||||
case BLOCK_MOVE: // Move
|
case BLOCK_MOVE: // Move
|
||||||
case BLOCK_DUPLICATE: // Duplicate
|
case BLOCK_DUPLICATE: // Duplicate
|
||||||
block->ClearItemsList();
|
|
||||||
|
|
||||||
if( GetCurPart() && !block->AppendUndo() )
|
if( GetCurPart() && !block->AppendUndo() )
|
||||||
SaveCopyInUndoList( GetCurPart() );
|
SaveCopyInUndoList( GetCurPart() );
|
||||||
|
|
||||||
pt = block->GetMoveVector();
|
pt = block->GetMoveVector();
|
||||||
//pt.y *= -1;
|
|
||||||
|
|
||||||
if( GetCurPart() )
|
if( GetCurPart() )
|
||||||
BlockMoveSelectedItems( pt, GetCurPart(), block );
|
BlockMoveSelectedItems( pt, GetCurPart(), block );
|
||||||
|
|
||||||
|
block->ClearItemsList();
|
||||||
m_canvas->Refresh( true );
|
m_canvas->Refresh( true );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_PASTE: // Paste (recopy the last block saved)
|
case BLOCK_PASTE: // Paste (recopy the last block saved)
|
||||||
block->ClearItemsList();
|
|
||||||
|
|
||||||
if( GetCurPart() )
|
if( GetCurPart() )
|
||||||
SaveCopyInUndoList( GetCurPart() );
|
SaveCopyInUndoList( GetCurPart() );
|
||||||
|
|
||||||
pt = block->GetMoveVector();
|
pt = block->GetMoveVector();
|
||||||
//pt.y = -pt.y;
|
|
||||||
|
|
||||||
pasteClipboard( pt );
|
pasteClipboard( pt );
|
||||||
|
|
||||||
|
block->ClearItemsList();
|
||||||
|
m_canvas->Refresh( true );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BLOCK_ZOOM: // Handled by HandleBlockEnd
|
case BLOCK_ZOOM: // Handled by HandleBlockEnd
|
||||||
|
|
Loading…
Reference in New Issue