diff --git a/pcbnew/tools/drawing_tool.cpp b/pcbnew/tools/drawing_tool.cpp index 4f72f224cd..98cd9c4c86 100644 --- a/pcbnew/tools/drawing_tool.cpp +++ b/pcbnew/tools/drawing_tool.cpp @@ -522,6 +522,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent ) grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); m_controls->SetSnapping( !evt->Modifier( MD_ALT ) ); VECTOR2I cursorPos = grid.BestSnapAnchor( m_controls->GetMousePosition(), nullptr ); + m_controls->ForceCursorPosition(true, cursorPos ); if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) ) { @@ -1003,6 +1004,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, aGraphic->SetStart( wxPoint( aStartingPoint->x, aStartingPoint->y ) ); cursorPos = grid.BestSnapAnchor( cursorPos, aGraphic ); + m_controls->ForceCursorPosition(true, cursorPos ); aGraphic->SetEnd( wxPoint( cursorPos.x, cursorPos.y ) ); if( aShape == S_SEGMENT ) @@ -1025,6 +1027,7 @@ bool DRAWING_TOOL::drawSegment( int aShape, DRAWSEGMENT*& aGraphic, grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); m_controls->SetSnapping( !evt->Modifier( MD_ALT ) ); cursorPos = grid.BestSnapAnchor( m_controls->GetMousePosition(), getDrawingLayer() ); + m_controls->ForceCursorPosition(true, cursorPos ); // 45 degree angle constraint enabled with an option and toggled with Ctrl const bool limit45 = ( frame()->Settings().m_use45DegreeGraphicSegments != !!( evt->Modifier( MD_CTRL ) ) ); @@ -1229,6 +1232,7 @@ bool DRAWING_TOOL::drawArc( DRAWSEGMENT*& aGraphic ) grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); m_controls->SetSnapping( !evt->Modifier( MD_ALT ) ); VECTOR2I cursorPos = grid.BestSnapAnchor( m_controls->GetMousePosition(), aGraphic ); + m_controls->ForceCursorPosition(true, cursorPos ); if( evt->IsClick( BUT_LEFT ) ) { @@ -1412,6 +1416,7 @@ int DRAWING_TOOL::drawZone( bool aKeepout, ZONE_MODE aMode ) grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); m_controls->SetSnapping( !evt->Modifier( MD_ALT ) ); VECTOR2I cursorPos = grid.BestSnapAnchor( m_controls->GetMousePosition(), layers ); + m_controls->ForceCursorPosition(true, cursorPos ); if( TOOL_EVT_UTILS::IsCancelInteractive( *evt ) ) { diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index fa1f95f987..1b33fdcda8 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -386,6 +386,7 @@ int EDIT_TOOL::Main( const TOOL_EVENT& aEvent ) if( m_dragging && evt->Category() == TC_MOUSE ) { m_cursor = grid.BestSnapAnchor( controls->GetMousePosition(), item_layers ); + controls->ForceCursorPosition(true, m_cursor ); VECTOR2I movement( m_cursor - prevPos ); selection.SetReferencePoint( m_cursor ); @@ -1220,6 +1221,7 @@ int EDIT_TOOL::MeasureTool( const TOOL_EVENT& aEvent ) grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); controls.SetSnapping( !evt->Modifier( MD_ALT ) ); const VECTOR2I cursorPos = grid.BestSnapAnchor( controls.GetMousePosition(), nullptr ); + controls.ForceCursorPosition(true, cursorPos ); if( evt->IsCancel() || TOOL_EVT_UTILS::IsCancelInteractive( *evt ) || evt->IsActivate() ) { diff --git a/pcbnew/tools/picker_tool.cpp b/pcbnew/tools/picker_tool.cpp index 592ab5d9ff..7761d04425 100644 --- a/pcbnew/tools/picker_tool.cpp +++ b/pcbnew/tools/picker_tool.cpp @@ -52,6 +52,7 @@ int PICKER_TOOL::Main( const TOOL_EVENT& aEvent ) grid.SetUseGrid( !evt->Modifier( MD_ALT ) ); controls->SetSnapping( !evt->Modifier( MD_ALT ) ); VECTOR2I cursorPos = grid.BestSnapAnchor( controls->GetMousePosition(), nullptr ); + controls->ForceCursorPosition(true, cursorPos ); if( evt->IsClick( BUT_LEFT ) ) {