Don't swally properties command when tool has no current item.

Fixes https://gitlab.com/kicad/code/kicad/issues/6311
This commit is contained in:
Jeff Young 2020-11-06 13:21:03 +00:00
parent 91ba002da7
commit 23d6cde0b0
1 changed files with 26 additions and 4 deletions

View File

@ -602,6 +602,10 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
m_view->Update( &selection() ); m_view->Update( &selection() );
frame()->SetMsgPanel( text ); frame()->SetMsgPanel( text );
} }
else
{
evt->SetPassEvent();
}
} }
else else
{ {
@ -817,7 +821,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
m_controls->SetAutoPan( true ); m_controls->SetAutoPan( true );
m_controls->CaptureCursor( true ); m_controls->CaptureCursor( true );
} }
break; break;
case SET_END: case SET_END:
{ {
@ -839,11 +843,12 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
KI_FALLTHROUGH; KI_FALLTHROUGH;
} }
else else
{
break; break;
}
} }
case SET_HEIGHT: case SET_HEIGHT:
{
if( dimension->Type() == PCB_DIM_LEADER_T ) if( dimension->Type() == PCB_DIM_LEADER_T )
{ {
assert( dimension->GetStart() != dimension->GetEnd() ); assert( dimension->GetStart() != dimension->GetEnd() );
@ -872,7 +877,6 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
break; break;
} }
}
if( ++step == FINISHED ) if( ++step == FINISHED )
{ {
@ -946,11 +950,16 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
} }
else if( evt->IsAction( &PCB_ACTIONS::properties ) ) else if( evt->IsAction( &PCB_ACTIONS::properties ) )
{ {
if( step != SET_ORIGIN ) if( step == SET_END || step == SET_HEIGHT )
{ {
frame()->OnEditItemRequest( dimension ); frame()->OnEditItemRequest( dimension );
dimension->Update(); dimension->Update();
frame()->SetMsgPanel( dimension ); frame()->SetMsgPanel( dimension );
break;
}
else
{
evt->SetPassEvent();
} }
} }
else else
@ -1360,6 +1369,11 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, PCB_SHAPE** aGraphic,
frame()->OnEditItemRequest( graphic ); frame()->OnEditItemRequest( graphic );
m_view->Update( &preview ); m_view->Update( &preview );
frame()->SetMsgPanel( graphic ); frame()->SetMsgPanel( graphic );
break;
}
else
{
evt->SetPassEvent();
} }
} }
else if( evt->IsClick( BUT_RIGHT ) ) else if( evt->IsClick( BUT_RIGHT ) )
@ -1681,6 +1695,10 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool
frame()->SetMsgPanel( graphic ); frame()->SetMsgPanel( graphic );
break; break;
} }
else
{
evt->SetPassEvent();
}
} }
else if( evt->IsClick( BUT_RIGHT ) ) else if( evt->IsClick( BUT_RIGHT ) )
{ {
@ -1985,6 +2003,10 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
zoneTool.OnGeometryChange( polyGeomMgr ); zoneTool.OnGeometryChange( polyGeomMgr );
frame()->SetMsgPanel( zoneTool.GetZone() ); frame()->SetMsgPanel( zoneTool.GetZone() );
} }
else
{
evt->SetPassEvent();
}
} }
else if( evt->IsAction( &ACTIONS::updateUnits ) ) else if( evt->IsAction( &ACTIONS::updateUnits ) )
{ {