Point Editor: allow snapping to off-grid start point

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/16244
This commit is contained in:
Mike Williams 2023-12-04 09:12:53 -05:00
parent b17ca50472
commit d468b6d542
1 changed files with 6 additions and 6 deletions

View File

@ -463,12 +463,8 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
if( grid ) if( grid )
{ {
grid->SetSnap( !evt->Modifier( MD_SHIFT ) ); grid->SetSnap( !evt->Modifier( MD_SHIFT ) );
grid->SetUseGrid( getView()->GetGAL()->GetGridSnapping() && grid->SetUseGrid( getView()->GetGAL()->GetGridSnapping()
!evt->DisableGridSnapping() ); && !evt->DisableGridSnapping() );
cursorPos = grid->Align( controls->GetMousePosition(),
GRID_HELPER_GRIDS::GRID_GRAPHICS );
controls->ForceCursorPosition( true, cursorPos );
} }
else else
{ {
@ -507,6 +503,10 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
bool snap = !evt->DisableGridSnapping(); bool snap = !evt->DisableGridSnapping();
cursorPos =
grid->Align( controls->GetMousePosition(), GRID_HELPER_GRIDS::GRID_GRAPHICS );
controls->ForceCursorPosition( true, cursorPos );
m_editedPoint->SetPosition( controls->GetCursorPosition( snap ) ); m_editedPoint->SetPosition( controls->GetCursorPosition( snap ) );
updateParentItem( snap ); updateParentItem( snap );