mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Make move tool obey snap settings
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21192
This commit is contained in:
parent
53e8d051e3
commit
8bf7975440
@ -421,6 +421,20 @@ void TOOL_BASE::updateEndItem( const TOOL_EVENT& aEvent )
|
||||
|
||||
controls()->ForceCursorPosition( true, m_endSnapPoint );
|
||||
|
||||
if( GetAngleSnapMode() != LEADER_MODE::DIRECT
|
||||
&& ( m_router->GetState() == ROUTER::DRAG_SEGMENT
|
||||
|| m_router->GetState() == ROUTER::DRAG_COMPONENT ) )
|
||||
{
|
||||
VECTOR2I moveVector = m_endSnapPoint - m_startSnapPoint;
|
||||
|
||||
if( GetAngleSnapMode() == LEADER_MODE::DEG45 )
|
||||
m_endSnapPoint = m_startSnapPoint + GetVectorSnapped45( moveVector );
|
||||
else if( GetAngleSnapMode() == LEADER_MODE::DEG90 )
|
||||
m_endSnapPoint = m_startSnapPoint + GetVectorSnapped90( moveVector );
|
||||
|
||||
controls()->ForceCursorPosition( true, m_endSnapPoint );
|
||||
}
|
||||
|
||||
if( m_endItem )
|
||||
{
|
||||
wxLogTrace( wxT( "PNS" ), wxT( "%s, layer : %d" ),
|
||||
|
@ -441,7 +441,7 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
|
||||
VECTOR2I prevPos;
|
||||
bool enableLocalRatsnest = true;
|
||||
|
||||
bool hv45Mode = false;
|
||||
bool hv45Mode = GetAngleSnapMode() != LEADER_MODE::DIRECT;
|
||||
bool eatFirstMouseUp = true;
|
||||
bool allowRedraw3D = cfg->m_Display.m_Live3DRefresh;
|
||||
bool showCourtyardConflicts = !m_isFootprintEditor && cfg->m_ShowCourtyardCollisions;
|
||||
@ -780,7 +780,7 @@ bool EDIT_TOOL::doMoveSelection( const TOOL_EVENT& aEvent, BOARD_COMMIT* aCommit
|
||||
}
|
||||
else if( evt->IsAction( &PCB_ACTIONS::toggleHV45Mode ) )
|
||||
{
|
||||
hv45Mode = !hv45Mode;
|
||||
hv45Mode = GetAngleSnapMode() != LEADER_MODE::DIRECT;
|
||||
displayConstraintsMessage( hv45Mode );
|
||||
evt->SetPassEvent( false );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user