Have another go at fixing 'w' command when wire tool is already active.
This commit is contained in:
parent
0445a9913f
commit
b03e9061ff
|
@ -646,7 +646,7 @@ int SCH_DRAWING_TOOL::StartWire( const TOOL_EVENT& aEvent )
|
||||||
int SCH_DRAWING_TOOL::DrawWire( const TOOL_EVENT& aEvent )
|
int SCH_DRAWING_TOOL::DrawWire( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( m_frame->GetToolId() == ID_WIRE_BUTT )
|
if( m_frame->GetToolId() == ID_WIRE_BUTT )
|
||||||
StartWire( aEvent );
|
return StartWire( aEvent );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_frame->SetToolID( ID_WIRE_BUTT, wxCURSOR_PENCIL, _( "Add wire" ) );
|
m_frame->SetToolID( ID_WIRE_BUTT, wxCURSOR_PENCIL, _( "Add wire" ) );
|
||||||
|
@ -668,7 +668,7 @@ int SCH_DRAWING_TOOL::StartBus( const TOOL_EVENT& aEvent )
|
||||||
int SCH_DRAWING_TOOL::DrawBus( const TOOL_EVENT& aEvent )
|
int SCH_DRAWING_TOOL::DrawBus( const TOOL_EVENT& aEvent )
|
||||||
{
|
{
|
||||||
if( m_frame->GetToolId() == ID_BUS_BUTT )
|
if( m_frame->GetToolId() == ID_BUS_BUTT )
|
||||||
StartBus( aEvent );
|
return StartBus( aEvent );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_frame->SetToolID( ID_BUS_BUTT, wxCURSOR_PENCIL, _( "Add bus" ) );
|
m_frame->SetToolID( ID_BUS_BUTT, wxCURSOR_PENCIL, _( "Add bus" ) );
|
||||||
|
@ -917,12 +917,19 @@ int SCH_DRAWING_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment )
|
||||||
// Clear flags used in edit functions.
|
// Clear flags used in edit functions.
|
||||||
m_frame->GetScreen()->ClearDrawingState();
|
m_frame->GetScreen()->ClearDrawingState();
|
||||||
m_frame->GetScreen()->SetCurItem( nullptr );
|
m_frame->GetScreen()->SetCurItem( nullptr );
|
||||||
}
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
|
|
||||||
if( evt->IsActivate() ) // now finish unconditionally
|
if( !evt->IsActivate() )
|
||||||
break;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( evt->IsAction( &SCH_ACTIONS::drawWire ) && aType == LAYER_WIRE )
|
||||||
|
; // don't cancel tool; we're going to re-enter
|
||||||
|
else if( evt->IsAction( &SCH_ACTIONS::drawBus ) && aType == LAYER_BUS )
|
||||||
|
; // don't cancel tool; we're going to re-enter
|
||||||
|
else
|
||||||
|
m_frame->SetNoToolSelected();
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if( evt->IsAction( &SCH_ACTIONS::finishDrawing ) )
|
else if( evt->IsAction( &SCH_ACTIONS::finishDrawing ) )
|
||||||
{
|
{
|
||||||
|
@ -1048,8 +1055,6 @@ int SCH_DRAWING_TOOL::doDrawSegments( int aType, SCH_LINE* aSegment )
|
||||||
m_controls->CaptureCursor( !!aSegment );
|
m_controls->CaptureCursor( !!aSegment );
|
||||||
}
|
}
|
||||||
|
|
||||||
m_frame->SetNoToolSelected();
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue