Eeschema: never replace event position in wire drawing tool

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7745
This commit is contained in:
Jon Evans 2021-03-01 12:17:08 -05:00
parent f4cc9b86e3
commit 375cd12258
1 changed files with 3 additions and 2 deletions

View File

@ -519,8 +519,9 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
grid.ClearMaskFlag( GRID_HELPER::HORIZONTAL );
}
wxPoint cursorPos = evt->IsPrime() ? (wxPoint) evt->Position()
: (wxPoint) controls->GetMousePosition();
wxPoint cursorPos = static_cast<wxPoint>( evt->HasPosition() ?
evt->Position() :
controls->GetMousePosition() );
cursorPos = (wxPoint) grid.BestSnapAnchor( cursorPos, LAYER_CONNECTABLE, segment );
controls->ForceCursorPosition( true, cursorPos );