pcbnew: Control cursor capture in microwave tool

Turns off cursor capture when the microwave tool is not actively drawing
a new inductor.

Fixes: lp:1792128
* https://bugs.launchpad.net/kicad/+bug/1792128
This commit is contained in:
Seth Hillbrand 2018-09-12 04:22:01 -07:00
parent 9b50b94069
commit ded64aef3d
1 changed files with 9 additions and 1 deletions

View File

@ -295,6 +295,8 @@ int MICROWAVE_TOOL::drawMicrowaveInductor( const TOOL_EVENT& aEvent )
controls.ShowCursor( true );
controls.SetSnapping( true );
controls.CaptureCursor( false );
controls.SetAutoPan( false );
view.Add( &previewRect );
@ -314,6 +316,9 @@ int MICROWAVE_TOOL::drawMicrowaveInductor( const TOOL_EVENT& aEvent )
// had an in-progress area, so start again but don't
// cancel the tool
originSet = false;
controls.CaptureCursor( false );
controls.SetAutoPan( false );
view.SetVisible( &previewRect, false );
view.Update( &previewRect, KIGFX::GEOMETRY );
}
@ -326,7 +331,6 @@ int MICROWAVE_TOOL::drawMicrowaveInductor( const TOOL_EVENT& aEvent )
tpGeomMgr.SetEnd( cursorPos );
originSet = true;
controls.CaptureCursor( true );
controls.SetAutoPan( true );
}
@ -342,6 +346,8 @@ int MICROWAVE_TOOL::drawMicrowaveInductor( const TOOL_EVENT& aEvent )
// start again if needed
originSet = false;
controls.CaptureCursor( false );
controls.SetAutoPan( false );
view.SetVisible( &previewRect, false );
view.Update( &previewRect, KIGFX::GEOMETRY );
@ -365,6 +371,8 @@ int MICROWAVE_TOOL::drawMicrowaveInductor( const TOOL_EVENT& aEvent )
}
}
controls.CaptureCursor( false );
controls.SetAutoPan( false );
view.Remove( &previewRect );
frame.SetNoToolSelected();