Removed 'undo inhibit' in EDIT_TOOL

This commit is contained in:
Maciej Suminski
2016-09-12 13:45:57 +02:00
parent 86895822b7
commit ad1111748e
2 changed files with 4 additions and 66 deletions
+4 -22
View File
@@ -60,7 +60,7 @@ using namespace std::placeholders;
EDIT_TOOL::EDIT_TOOL() :
PCB_TOOL( "pcbnew.InteractiveEdit" ), m_selectionTool( NULL ),
m_dragging( false ), m_undoInhibit( 0 ), m_updateFlag( KIGFX::VIEW_ITEM::NONE )
m_dragging( false ), m_updateFlag( KIGFX::VIEW_ITEM::NONE )
{
}
@@ -115,9 +115,6 @@ bool EDIT_TOOL::invokeInlineRouter()
TRACK* track = uniqueSelected<TRACK>();
VIA* via = uniqueSelected<VIA>();
if( isUndoInhibited() )
return false;
if( track || via )
{
ROUTER_TOOL* theRouter = static_cast<ROUTER_TOOL*>( m_toolMgr->FindTool( "pcbnew.InteractiveRouter" ) );
@@ -247,9 +244,6 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
controls->SetAutoPan( true );
m_dragging = true;
// Do not save intermediate modifications when an item is dragged
incUndoInhibit();
}
}
@@ -328,9 +322,6 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent )
}
} while( ( evt = Wait() ) ); //Should be assignment not equality test
if( m_dragging )
decUndoInhibit();
m_dragging = false;
m_offset.x = 0;
m_offset.y = 0;
@@ -419,7 +410,7 @@ int EDIT_TOOL::Rotate( const TOOL_EVENT& aEvent )
item->Rotate( rotatePoint, editFrame->GetRotationAngle() );
}
if( !isUndoInhibited() )
if( !m_dragging )
m_commit->Push( _( "Rotate" ) );
if( unselect )
@@ -451,7 +442,7 @@ int EDIT_TOOL::Flip( const TOOL_EVENT& aEvent )
item->Flip( flipPoint );
}
if( !isUndoInhibited() )
if( !m_dragging )
m_commit->Push( _( "Flip" ) );
if( unselect )
@@ -521,8 +512,7 @@ int EDIT_TOOL::MoveExact( const TOOL_EVENT& aEvent )
item->ViewUpdate( KIGFX::VIEW_ITEM::GEOMETRY );
}
if( !isUndoInhibited() )
m_commit->Push( _( "Move exact" ) );
m_commit->Push( _( "Move exact" ) );
if( unselect )
m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true );
@@ -551,11 +541,6 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
// we have a selection to work on now, so start the tool process
PCB_BASE_EDIT_FRAME* editFrame = getEditFrame<PCB_BASE_EDIT_FRAME>();
// prevent other tools making undo points while the duplicate is going on
// so that if you cancel, you don't get a duplicate object hiding over
// the original
incUndoInhibit();
std::vector<BOARD_ITEM*> old_items;
for( int i = 0; i < selection.Size(); ++i )
@@ -611,9 +596,6 @@ int EDIT_TOOL::Duplicate( const TOOL_EVENT& aEvent )
Main( evt );
}
// and re-enable undos
decUndoInhibit();
return 0;
};