Make place drill origin and place grid origin one-shot commands.

Fixes: lp:1751747
* https://bugs.launchpad.net/kicad/+bug/1751747
This commit is contained in:
Jeff Young 2019-06-12 23:04:00 +01:00
parent ae8daee83c
commit df08f9921f
4 changed files with 8 additions and 8 deletions

View File

@ -1169,14 +1169,13 @@ int PCB_EDITOR_CONTROL::CrossProbeSchToPcb( const TOOL_EVENT& aEvent )
}
bool PCB_EDITOR_CONTROL::DoSetDrillOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
void PCB_EDITOR_CONTROL::DoSetDrillOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
BOARD_ITEM* originViewItem, const VECTOR2D& aPosition )
{
aFrame->SetAuxOrigin( wxPoint( aPosition.x, aPosition.y ) );
originViewItem->SetPosition( wxPoint( aPosition.x, aPosition.y ) );
aView->MarkDirty();
aFrame->OnModify();
return true;
}
@ -1184,7 +1183,8 @@ bool PCB_EDITOR_CONTROL::SetDrillOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFr
BOARD_ITEM* originViewItem, const VECTOR2D& aPosition )
{
aFrame->SaveCopyInUndoList( originViewItem, UR_DRILLORIGIN );
return DoSetDrillOrigin( aView, aFrame, originViewItem, aPosition );
DoSetDrillOrigin( aView, aFrame, originViewItem, aPosition );
return false; // drill origin is a one-shot; don't continue with tool
}

View File

@ -121,7 +121,7 @@ public:
BOARD_ITEM* aItem, const VECTOR2D& aPoint );
///> Low-level access (below undo) to setting the drill origin
static bool DoSetDrillOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
static void DoSetDrillOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
BOARD_ITEM* aItem, const VECTOR2D& aPoint );
///> Highlights net belonging to the item under the cursor.

View File

@ -573,7 +573,7 @@ int PCBNEW_CONTROL::GridFast2( const TOOL_EVENT& aEvent )
}
bool PCBNEW_CONTROL::DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
void PCBNEW_CONTROL::DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
BOARD_ITEM* originViewItem, const VECTOR2D& aPoint )
{
aFrame->SetGridOrigin( wxPoint( aPoint.x, aPoint.y ) );
@ -581,7 +581,6 @@ bool PCBNEW_CONTROL::DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame
originViewItem->SetPosition( wxPoint( aPoint.x, aPoint.y ) );
aView->MarkDirty();
aFrame->OnModify();
return true;
}
@ -589,7 +588,8 @@ bool PCBNEW_CONTROL::SetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
BOARD_ITEM* originViewItem, const VECTOR2D& aPoint )
{
aFrame->SaveCopyInUndoList( originViewItem, UR_GRIDORIGIN );
return DoSetGridOrigin( aView, aFrame, originViewItem, aPoint );
DoSetGridOrigin( aView, aFrame, originViewItem, aPoint );
return false; // Set grid origin is a one-shot; don't keep tool active
}

View File

@ -83,7 +83,7 @@ public:
BOARD_ITEM* originViewItem, const VECTOR2D& aPoint );
// Low-level access (below undo) to setting the grid origin
static bool DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
static void DoSetGridOrigin( KIGFX::VIEW* aView, PCB_BASE_FRAME* aFrame,
BOARD_ITEM* originViewItem, const VECTOR2D& aPoint );
int Undo( const TOOL_EVENT& aEvent );