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( evt->IsCancelInteractive() )
|
||||||
{
|
{
|
||||||
if( polyGeomMgr.IsPolygonInProgress() )
|
if( polyGeomMgr.IsPolygonInProgress() )
|
||||||
|
{
|
||||||
cleanup();
|
cleanup();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_frame->PopTool( tool );
|
m_frame->PopTool( tool );
|
||||||
|
@ -2198,6 +2200,8 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
|
||||||
|
|
||||||
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||||
m_controls->ForceCursorPosition( false );
|
m_controls->ForceCursorPosition( false );
|
||||||
|
controls()->SetAutoPan( false );
|
||||||
|
m_controls->CaptureCursor( false );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,7 +121,9 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if( newItem )
|
else if( newItem )
|
||||||
|
{
|
||||||
cleanup();
|
cleanup();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
frame()->PopTool( aTool );
|
frame()->PopTool( aTool );
|
||||||
|
@ -258,6 +260,8 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool,
|
||||||
|
|
||||||
view()->Remove( &preview );
|
view()->Remove( &preview );
|
||||||
frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
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( evt->IsCancelInteractive() )
|
||||||
{
|
{
|
||||||
if( originSet )
|
if( originSet )
|
||||||
|
{
|
||||||
clearRuler();
|
clearRuler();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
frame()->PopTool( tool );
|
frame()->PopTool( tool );
|
||||||
|
@ -328,6 +330,8 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
|
||||||
view.Remove( &ruler );
|
view.Remove( &ruler );
|
||||||
|
|
||||||
frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW );
|
||||||
|
controls.SetAutoPan( false );
|
||||||
|
controls.CaptureCursor( false );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue