diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 81599edc72..1222dbd94e 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -548,6 +548,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) Activate(); // Must be done after Activate() so that it gets set into the correct context m_controls->ShowCursor( true ); + m_controls->ForceCursorPosition( false ); // do not capture or auto-pan until we start placing some text // Set initial cursor setCursor(); @@ -742,6 +743,7 @@ int DRAWING_TOOL::PlaceText( const TOOL_EVENT& aEvent ) m_controls->SetAutoPan( false ); m_controls->CaptureCursor( false ); + m_controls->ForceCursorPosition( false ); m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); if( selection().Empty() ) @@ -795,6 +797,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) { m_controls->SetAutoPan( false ); m_controls->CaptureCursor( false ); + m_controls->ForceCursorPosition( false ); preview.Clear(); m_view->Update( &preview ); @@ -818,6 +821,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) Activate(); // Must be done after Activate() so that it gets set into the correct context m_controls->ShowCursor( true ); + m_controls->ForceCursorPosition( false ); // Set initial cursor setCursor(); @@ -1362,6 +1366,7 @@ int DRAWING_TOOL::PlaceImportedGraphics( const TOOL_EVENT& aEvent ) m_view->Remove( &preview ); m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); + m_controls->ForceCursorPosition( false ); m_frame->PopTool( tool ); @@ -1400,6 +1405,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent ) m_controls->ShowCursor( true ); m_controls->SetAutoPan( true ); m_controls->CaptureCursor( false ); + m_controls->ForceCursorPosition( false ); // Set initial cursor setCursor(); @@ -1446,6 +1452,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent ) } m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); + m_controls->ForceCursorPosition( false ); return 0; } @@ -1541,6 +1548,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, PCB_SHAPE** aGraphic, }; m_controls->ShowCursor( true ); + m_controls->ForceCursorPosition( false ); // Set initial cursor setCursor(); @@ -1861,6 +1869,7 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool }; m_controls->ShowCursor( true ); + m_controls->ForceCursorPosition( false ); // Set initial cursor setCursor(); @@ -2189,6 +2198,7 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent ) Activate(); // Must be done after Activate() so that it gets set into the correct context m_controls->ShowCursor( true ); + m_controls->ForceCursorPosition( false ); // Set initial cursor setCursor(); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 6559d7f08a..8e0fbbb180 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -752,6 +752,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference ) // Must be done after Activate() so that it gets set into the correct context controls->ShowCursor( true ); controls->SetAutoPan( true ); + controls->ForceCursorPosition( false ); if( aPickReference && !pickReferencePoint( _( "Select reference point for move..." ), "", "", pickedReferencePoint ) ) diff --git a/pcbnew/tools/pad_tool.cpp b/pcbnew/tools/pad_tool.cpp index b0f7439e47..af78891f94 100644 --- a/pcbnew/tools/pad_tool.cpp +++ b/pcbnew/tools/pad_tool.cpp @@ -328,6 +328,7 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent ) Activate(); // Must be done after Activate() so that it gets set into the correct context getViewControls()->ShowCursor( true ); + getViewControls()->ForceCursorPosition( false ); // Set initial cursor setCursor(); @@ -478,6 +479,7 @@ int PAD_TOOL::EnumeratePads( const TOOL_EVENT& aEvent ) statusPopup.Hide(); frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); + getViewControls()->ForceCursorPosition( false ); return 0; } diff --git a/pcbnew/tools/pcb_picker_tool.cpp b/pcbnew/tools/pcb_picker_tool.cpp index 965f544e5c..2023d72ffe 100644 --- a/pcbnew/tools/pcb_picker_tool.cpp +++ b/pcbnew/tools/pcb_picker_tool.cpp @@ -123,7 +123,9 @@ int PCB_PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) break; } else + { setControls(); + } } else if( evt->IsMotion() ) @@ -152,7 +154,9 @@ int PCB_PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) } else + { evt->SetPassEvent(); + } } if( m_finalizeHandler ) diff --git a/pcbnew/tools/pcb_tool_base.cpp b/pcbnew/tools/pcb_tool_base.cpp index 297a5befcb..468343c23b 100644 --- a/pcbnew/tools/pcb_tool_base.cpp +++ b/pcbnew/tools/pcb_tool_base.cpp @@ -52,6 +52,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, Activate(); // Must be done after Activate() so that it gets set into the correct context controls()->ShowCursor( true ); + controls()->ForceCursorPosition( false ); // do not capture or auto-pan until we start placing an item PCB_GRID_HELPER grid( m_toolMgr, frame()->GetMagneticItemsSettings() ); @@ -120,6 +121,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, controls()->SetAutoPan( false ); controls()->CaptureCursor( false ); controls()->ShowCursor( true ); + controls()->ForceCursorPosition( false ); }; if( evt->IsCancelInteractive() ) @@ -266,6 +268,7 @@ void PCB_TOOL_BASE::doInteractiveItemPlacement( const std::string& aTool, frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); controls()->SetAutoPan( false ); controls()->CaptureCursor( false ); + controls()->ForceCursorPosition( false ); } diff --git a/pcbnew/tools/pcb_viewer_tools.cpp b/pcbnew/tools/pcb_viewer_tools.cpp index 21c1035f32..3068864af9 100644 --- a/pcbnew/tools/pcb_viewer_tools.cpp +++ b/pcbnew/tools/pcb_viewer_tools.cpp @@ -219,6 +219,7 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent ) view.SetVisible( &ruler, false ); controls.SetAutoPan( false ); controls.CaptureCursor( false ); + controls.ForceCursorPosition( false ); originSet = false; }; @@ -227,6 +228,8 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent ) controls.ShowCursor( true ); controls.SetAutoPan( false ); controls.CaptureCursor( false ); + controls.ForceCursorPosition( false ); + // Set initial cursor setCursor(); @@ -236,7 +239,7 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent ) grid.SetSnap( !evt->Modifier( MD_SHIFT ) ); grid.SetUseGrid( view.GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() ); const VECTOR2I cursorPos = grid.BestSnapAnchor( controls.GetMousePosition(), nullptr ); - controls.ForceCursorPosition(true, cursorPos ); + controls.ForceCursorPosition( true, cursorPos ); if( evt->IsCancelInteractive() ) { @@ -339,6 +342,7 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent ) frame()->GetCanvas()->SetCurrentCursor( KICURSOR::ARROW ); controls.SetAutoPan( false ); controls.CaptureCursor( false ); + controls.ForceCursorPosition( false ); return 0; }