From d08f19a0a26d5cac4d35d587db830b51ef2e031b Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 15 Feb 2018 11:53:17 +0100 Subject: [PATCH] FP placer: enable autopanning/cursor capture only during placement Fixes: lp:1749548 * https://bugs.launchpad.net/kicad/+bug/1749548 --- pcbnew/tools/pcb_editor_control.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index 78f05ecf3c..03d86b2c1e 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -482,11 +482,6 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) commit.Push( _( "Place a module" ) ); module = NULL; // to indicate that there is no module that we currently modify } - - bool placing = ( module != NULL ); - - controls->SetAutoPan( placing ); - controls->CaptureCursor( placing ); } else if( evt->IsClick( BUT_RIGHT ) ) @@ -506,6 +501,10 @@ int PCB_EDITOR_CONTROL::PlaceModule( const TOOL_EVENT& aEvent ) // Calling 'Properties' action clears the selection, so we need to restore it reselect = true; } + + // Enable autopanning and cursor capture only when there is a module to be placed + controls->SetAutoPan( !!module ); + controls->CaptureCursor( !!module ); } m_frame->SetNoToolSelected();