Drawing tool needs to pass resetLocalCoords event after recording it.
Fixes https://gitlab.com/kicad/code/kicad/issues/5879
This commit is contained in:
parent
d31c5c41e6
commit
305fe54971
|
@ -581,8 +581,10 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
frame()->SetMsgPanel( board() );
|
||||
return 0;
|
||||
|
@ -921,8 +923,10 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
if( step != SET_ORIGIN )
|
||||
delete dimension;
|
||||
|
@ -1085,8 +1089,10 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent )
|
|||
break; // This is a one-shot command, not a tool
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
preview.Clear();
|
||||
m_view->Remove( &preview );
|
||||
|
@ -1150,8 +1156,10 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
|
|||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1211,6 +1219,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, PCB_SHAPE*
|
|||
m_toolMgr->RunAction( ACTIONS::cursorClick );
|
||||
|
||||
frame()->SetMsgPanel( graphic );
|
||||
|
||||
// Main loop: keep receiving events
|
||||
while( TOOL_EVENT* evt = Wait() )
|
||||
{
|
||||
|
@ -1230,7 +1239,8 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, PCB_SHAPE*
|
|||
if( evt->Modifier( MD_CTRL ) )
|
||||
limit45 = !limit45;
|
||||
|
||||
auto cleanup = [&] () {
|
||||
auto cleanup = [&]()
|
||||
{
|
||||
preview.Clear();
|
||||
m_view->Update( &preview );
|
||||
delete graphic;
|
||||
|
@ -1403,10 +1413,13 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, int aShape, PCB_SHAPE*
|
|||
else if( evt->IsAction( &ACTIONS::resetLocalCoords ) )
|
||||
{
|
||||
isLocalOriginSet = true;
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
}
|
||||
|
||||
if( !isLocalOriginSet ) // reset the relative coordinte if it was not set before
|
||||
m_frame->GetScreen()->m_LocalOrigin = VECTOR2D( 0, 0 );
|
||||
|
@ -1596,7 +1609,9 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool
|
|||
arcManager.ToggleClockwise();
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
|
||||
if( arcManager.IsComplete() )
|
||||
{
|
||||
|
@ -1858,7 +1873,9 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
evt->SetPassEvent();
|
||||
}
|
||||
|
||||
} // end while
|
||||
|
||||
|
|
Loading…
Reference in New Issue