Make sure that a tool never exits with autopan or capture.
Fixes https://gitlab.com/kicad/code/kicad/issues/8459
This commit is contained in:
parent
4a77a4080d
commit
0d8a9a1091
|
@ -2055,7 +2055,9 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
|||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
if( polyGeomMgr.IsPolygonInProgress() )
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_frame->PopTool( tool );
|
||||
|
@ -2198,6 +2200,8 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
|||
|
||||
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||
m_controls->ForceCursorPosition( false );
|
||||
controls()->SetAutoPan( false );
|
||||
m_controls->CaptureCursor( false );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,7 +121,9 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
|
|||
break;
|
||||
}
|
||||
else if( newItem )
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
else
|
||||
{
|
||||
frame()->PopTool( aTool );
|
||||
|
@ -258,6 +260,8 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
|
|||
|
||||
view()->Remove( &preview );
|
||||
frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||
controls()->SetAutoPan( false );
|
||||
controls()->CaptureCursor( false );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -252,7 +252,9 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
|
|||
if( evt->IsCancelInteractive() )
|
||||
{
|
||||
if( originSet )
|
||||
{
|
||||
clearRuler();
|
||||
}
|
||||
else
|
||||
{
|
||||
frame()->PopTool( tool );
|
||||
|
@ -328,6 +330,8 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
|
|||
view.Remove( &ruler );
|
||||
|
||||
frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||
controls.SetAutoPan( false );
|
||||
controls.CaptureCursor( false );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue