Move grid disable modifier from ALT to CTRL.

Also had to move the H/V/45 disable modifier from CTRL to SHIFT.

Fixes https://gitlab.com/kicad/code/kicad/issues/8124
This commit is contained in:
Jeff Young 2021-05-09 20:17:01 +01:00
parent 7c66a0a594
commit 7356f9568d
21 changed files with 56 additions and 50 deletions

View File

@ -54,8 +54,9 @@ static GESTURE_PSEUDO_ACTION* g_gesturePseudoActions[] = {
new GESTURE_PSEUDO_ACTION( _( "Toggle Selection State" ), MD_ALT + PSEUDO_WXK_CLICK ),
new GESTURE_PSEUDO_ACTION( _( "Remove from Selection" ), MD_SHIFT + MD_ALT + PSEUDO_WXK_CLICK ),
#endif
new GESTURE_PSEUDO_ACTION( _( "Ignore Grid Snaps" ), MD_ALT ),
new GESTURE_PSEUDO_ACTION( _( "Ignore Grid Snaps" ), MD_CTRL ),
new GESTURE_PSEUDO_ACTION( _( "Ignore Other Snaps" ), MD_SHIFT ),
new GESTURE_PSEUDO_ACTION( _( "Ignore H/V/45 Constraints" ), MD_SHIFT )
};

View File

@ -310,7 +310,7 @@ int EE_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
modified = true;
}
bool snap = !evt->Modifier( MD_ALT );
bool snap = !evt->DisableGridSnapping();
if( item->Type() == LIB_ARC_T && getEditedPointIndex() == ARC_CENTER )
snap = false;
@ -833,7 +833,7 @@ int EE_POINT_EDITOR::addCorner( const TOOL_EVENT& aEvent )
if( !polyLine )
return false;
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() );
polyLine->AddCorner( mapCoords( cursorPos ) );
updateItem( polyLine, true );

View File

@ -186,7 +186,7 @@ int SCH_DRAWING_TOOLS::PlaceSymbol( const TOOL_EVENT& aEvent )
while( TOOL_EVENT* evt = Wait() )
{
setCursor();
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
if( evt->IsCancelInteractive() )
{
@ -418,7 +418,7 @@ int SCH_DRAWING_TOOLS::PlaceImage( const TOOL_EVENT& aEvent )
while( TOOL_EVENT* evt = Wait() )
{
setCursor();
cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
if( evt->IsCancelInteractive() )
{
@ -684,7 +684,7 @@ int SCH_DRAWING_TOOLS::SingleClickPlace( const TOOL_EVENT& aEvent )
{
setCursor();
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
cursorPos = evt->IsPrime() ? (wxPoint) evt->Position()
: (wxPoint) controls->GetMousePosition();
@ -1042,7 +1042,7 @@ int SCH_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
{
setCursor();
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
VECTOR2I cursorPos = evt->IsPrime() ? evt->Position() : controls->GetMousePosition();
cursorPos = grid.BestSnapAnchor( cursorPos, snapLayer, item );
@ -1272,7 +1272,7 @@ int SCH_DRAWING_TOOLS::DrawSheet( const TOOL_EVENT& aEvent )
{
setCursor();
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
if( evt->IsCancelInteractive() )
{

View File

@ -1709,7 +1709,7 @@ int SCH_EDIT_TOOL::ChangeTextType( const TOOL_EVENT& aEvent )
int SCH_EDIT_TOOL::BreakWire( const TOOL_EVENT& aEvent )
{
wxPoint cursorPos = wxPoint( getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) ) );
wxPoint cursorPos = (wxPoint) getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() );
EE_SELECTION& selection = m_selectionTool->RequestSelection( EE_COLLECTOR::WiresOnly );
std::vector<SCH_LINE*> lines;

View File

@ -887,7 +887,7 @@ static bool highlightNet( TOOL_MANAGER* aToolMgr, const VECTOR2D& aPosition )
int SCH_EDITOR_CONTROL::HighlightNet( const TOOL_EVENT& aEvent )
{
KIGFX::VIEW_CONTROLS* controls = getViewControls();
VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.DisableGridSnapping() );
highlightNet( m_toolMgr, cursorPos );
@ -907,7 +907,7 @@ int SCH_EDITOR_CONTROL::AssignNetclass( const TOOL_EVENT& aEvent )
{
EE_SELECTION_TOOL* selectionTool = m_toolMgr->GetTool<EE_SELECTION_TOOL>();
KIGFX::VIEW_CONTROLS* controls = getViewControls();
VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
VECTOR2D cursorPos = controls->GetCursorPosition( !aEvent.DisableGridSnapping() );
// TODO remove once real-time connectivity is a given
if( !ADVANCED_CFG::GetCfg().m_RealTimeConnectivity || !CONNECTION_GRAPH::m_allowRealTime )

View File

@ -288,7 +288,7 @@ int SCH_LINE_WIRE_BUS_TOOL::DrawSegments( const TOOL_EVENT& aEvent )
{
EE_GRID_HELPER grid( m_toolMgr );
grid.SetSnap( !aEvent.Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !aEvent.Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !aEvent.DisableGridSnapping() );
VECTOR2D cursorPos = grid.BestSnapAnchor( aEvent.Position(), LAYER_CONNECTABLE, nullptr );
startSegments( params->layer, cursorPos );
@ -535,7 +535,7 @@ int SCH_LINE_WIRE_BUS_TOOL::doDrawSegments( const std::string& aTool, int aType,
setCursor();
grid.SetMask( GRID_HELPER::ALL );
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
if( segment )
{

View File

@ -160,7 +160,7 @@ int SCH_MOVE_TOOL::Main( const TOOL_EVENT& aEvent )
{
m_frame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING );
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
if( evt->IsAction( &EE_ACTIONS::moveActivate )
|| evt->IsAction( &EE_ACTIONS::restartMove )

View File

@ -107,7 +107,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::TwoClickPlace( const TOOL_EVENT& aEvent )
{
setCursor();
cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
auto cleanup =
[&] ()
@ -295,7 +295,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
{
setCursor();
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
auto cleanup =
[&] ()
@ -458,7 +458,7 @@ int SYMBOL_EDITOR_DRAWING_TOOLS::PlaceAnchor( const TOOL_EVENT& aEvent )
if( !part )
continue;
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
wxPoint offset( -cursorPos.x, cursorPos.y );
part->SetOffset( offset );

View File

@ -290,7 +290,7 @@ int GERBVIEW_INSPECTION_TOOL::MeasureTool( const TOOL_EVENT& aEvent )
// move or drag when origin set updates rules
else if( originSet && ( evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) )
{
twoPtMgr.SetAngleSnap( evt->Modifier( MD_CTRL ) );
twoPtMgr.SetAngleSnap( evt->Modifier( MD_SHIFT ) );
twoPtMgr.SetEnd( cursorPos );
view.SetVisible( &ruler, true );

View File

@ -354,6 +354,11 @@ public:
return m_modifiers & aMask;
}
bool DisableGridSnapping() const
{
return Modifier( MD_CTRL );
}
int KeyCode() const
{
return m_keyCode;

View File

@ -107,7 +107,7 @@ int PL_DRAWING_TOOLS::PlaceItem( const TOOL_EVENT& aEvent )
{
setCursor();
cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
auto cleanup =
[&] ()
@ -251,7 +251,7 @@ int PL_DRAWING_TOOLS::DrawShape( const TOOL_EVENT& aEvent )
{
setCursor();
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->Modifier( MD_ALT ) );
VECTOR2I cursorPos = getViewControls()->GetCursorPosition( !evt->DisableGridSnapping() );
if( evt->IsCancelInteractive() || evt->IsActivate() )
{

View File

@ -206,7 +206,7 @@ int PL_POINT_EDITOR::Main( const TOOL_EVENT& aEvent )
modified = true;
}
m_editedPoint->SetPosition( controls->GetCursorPosition( !evt->Modifier( MD_ALT ) ) );
m_editedPoint->SetPosition( controls->GetCursorPosition( !evt->DisableGridSnapping() ) );
updateItem();
updatePoints();

View File

@ -214,7 +214,7 @@ int MICROWAVE_TOOL::drawMicrowaveInductor( const TOOL_EVENT& aEvent )
// the end point
else if( originSet && ( evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) )
{
tpGeomMgr.SetAngleSnap( evt->Modifier( MD_CTRL ) );
tpGeomMgr.SetAngleSnap( evt->Modifier( MD_SHIFT ) );
tpGeomMgr.SetEnd( cursorPos );
view.SetVisible( &previewRect, true );

View File

@ -264,7 +264,7 @@ void TOOL_BASE::updateStartItem( const TOOL_EVENT& aEvent, bool aIgnorePads )
GAL* gal = m_toolMgr->GetView()->GetGAL();
controls()->ForceCursorPosition( false );
m_gridHelper->SetUseGrid( gal->GetGridSnapping() && !aEvent.Modifier( MD_ALT ) );
m_gridHelper->SetUseGrid( gal->GetGridSnapping() && !aEvent.DisableGridSnapping() );
m_gridHelper->SetSnap( !aEvent.Modifier( MD_SHIFT ) );
if( aEvent.IsMotion() || aEvent.IsClick() )
@ -289,7 +289,7 @@ void TOOL_BASE::updateEndItem( const TOOL_EVENT& aEvent )
int layer;
GAL* gal = m_toolMgr->GetView()->GetGAL();
m_gridHelper->SetUseGrid( gal->GetGridSnapping() && !aEvent.Modifier( MD_ALT ) );
m_gridHelper->SetUseGrid( gal->GetGridSnapping() && !aEvent.DisableGridSnapping() );
m_gridHelper->SetSnap( !aEvent.Modifier( MD_SHIFT ) );
controls()->ForceCursorPosition( false );

View File

@ -1100,7 +1100,7 @@ void ROUTER_TOOL::performRouting()
if( evt->IsMotion() )
{
m_router->SetOrthoMode( evt->Modifier( MD_CTRL ) );
m_router->SetOrthoMode( evt->Modifier( MD_SHIFT ) );
updateEndItem( *evt );
m_router->Move( m_endSnapPoint, m_endItem );
}
@ -1339,7 +1339,7 @@ int ROUTER_TOOL::MainLoop( const TOOL_EVENT& aEvent )
if( evt->HasPosition() )
{
if( evt->Modifier( MD_CTRL ) )
if( evt->Modifier( MD_SHIFT ) )
performDragging( PNS::DM_ANY );
else
performRouting();
@ -1598,7 +1598,7 @@ int ROUTER_TOOL::InlineDrag( const TOOL_EVENT& aEvent )
VECTOR2I p0 = controls()->GetCursorPosition( false );
VECTOR2I p = p0;
m_gridHelper->SetUseGrid( gal->GetGridSnapping() && !aEvent.Modifier( MD_ALT ) );
m_gridHelper->SetUseGrid( gal->GetGridSnapping() && !aEvent.DisableGridSnapping() );
m_gridHelper->SetSnap( !aEvent.Modifier( MD_SHIFT ) );
if( startItem )
@ -1797,7 +1797,7 @@ int ROUTER_TOOL::InlineBreakTrack( const TOOL_EVENT& aEvent )
TOOL_MANAGER* toolManager = frame()->GetToolManager();
GAL* gal = toolManager->GetView()->GetGAL();
m_gridHelper->SetUseGrid( gal->GetGridSnapping() && !aEvent.Modifier( MD_ALT ) );
m_gridHelper->SetUseGrid( gal->GetGridSnapping() && !aEvent.DisableGridSnapping() );
m_gridHelper->SetSnap( !aEvent.Modifier( MD_SHIFT ) );
if( toolManager->IsContextMenuActive() )

View File

@ -951,7 +951,7 @@ int BOARD_EDITOR_CONTROL::PlaceFootprint( const TOOL_EVENT& aEvent )
while( TOOL_EVENT* evt = Wait() )
{
setCursor();
cursorPos = controls->GetCursorPosition( !evt->Modifier( MD_ALT ) );
cursorPos = controls->GetCursorPosition( !evt->DisableGridSnapping() );
if( reselect && fp )
m_toolMgr->RunAction( PCB_ACTIONS::selectItem, true, fp );
@ -1191,7 +1191,7 @@ int BOARD_EDITOR_CONTROL::PlaceTarget( const TOOL_EVENT& aEvent )
while( TOOL_EVENT* evt = Wait() )
{
setCursor();
cursorPos = controls->GetCursorPosition( !evt->Modifier( MD_ALT ) );
cursorPos = controls->GetCursorPosition( !evt->DisableGridSnapping() );
if( evt->IsCancelInteractive() )
{

View File

@ -254,7 +254,7 @@ int DRAWING_TOOL::DrawLine( const TOOL_EVENT& aEvent )
line->SetFlags( IS_NEW );
if( aEvent.HasPosition() )
startingPoint = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
startingPoint = getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() );
std::string tool = aEvent.GetCommandStr().get();
m_frame->PushTool( tool );
@ -301,7 +301,7 @@ int DRAWING_TOOL::DrawRectangle( const TOOL_EVENT& aEvent )
rect->SetFlags(IS_NEW );
if( aEvent.HasPosition() )
startingPoint = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
startingPoint = getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() );
std::string tool = aEvent.GetCommandStr().get();
m_frame->PushTool( tool );
@ -347,7 +347,7 @@ int DRAWING_TOOL::DrawCircle( const TOOL_EVENT& aEvent )
circle->SetFlags( IS_NEW );
if( aEvent.HasPosition() )
startingPoint = getViewControls()->GetCursorPosition( !aEvent.Modifier( MD_ALT ) );
startingPoint = getViewControls()->GetCursorPosition( !aEvent.DisableGridSnapping() );
std::string tool = aEvent.GetCommandStr().get();
m_frame->PushTool( tool );
@ -719,7 +719,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
setCursor();
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
VECTOR2I cursorPos = evt->HasPosition() ? evt->Position() : m_controls->GetMousePosition();
@ -860,7 +860,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
dimension->SetEnd( (wxPoint) cursorPos );
dimension->Update();
if( !!evt->Modifier( MD_CTRL ) || dimension->Type() == PCB_DIM_CENTER_T )
if( !!evt->Modifier( MD_SHIFT ) || dimension->Type() == PCB_DIM_CENTER_T )
constrainDimension( dimension );
// Dimensions that have origin and end in the same spot are not valid
@ -941,7 +941,7 @@ int DRAWING_TOOL::DrawDimension( const TOOL_EVENT& aEvent )
dimension->Update();
if( !!evt->Modifier( MD_CTRL ) || dimension->Type() == PCB_DIM_CENTER_T )
if( !!evt->Modifier( MD_SHIFT ) || dimension->Type() == PCB_DIM_CENTER_T )
constrainDimension( dimension );
break;
@ -1272,7 +1272,7 @@ int DRAWING_TOOL::SetAnchor( const TOOL_EVENT& aEvent )
setCursor();
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
VECTOR2I cursorPos = grid.BestSnapAnchor( m_controls->GetMousePosition(),
LSET::AllLayersMask() );
m_controls->ForceCursorPosition( true, cursorPos );
@ -1407,14 +1407,14 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, PCB_SHAPE** aGraphic,
m_frame->SetMsgPanel( graphic );
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
cursorPos = grid.BestSnapAnchor( m_controls->GetMousePosition(), drawingLayer );
m_controls->ForceCursorPosition( true, cursorPos );
// 45 degree angle constraint enabled with an option and toggled with Ctrl
bool limit45 = frame()->Settings().m_Use45DegreeGraphicSegments;
if( evt->Modifier( MD_CTRL ) )
if( evt->Modifier( MD_SHIFT ) )
limit45 = !limit45;
if( evt->IsCancelInteractive() )
@ -1581,7 +1581,7 @@ bool DRAWING_TOOL::drawSegment( const std::string& aTool, PCB_SHAPE** aGraphic,
// 45 degree lines
if( started
&& ( ( limit45 && shape == PCB_SHAPE_TYPE::SEGMENT )
|| ( evt->Modifier( MD_CTRL ) && shape == PCB_SHAPE_TYPE::RECT ) ) )
|| ( evt->Modifier( MD_SHIFT ) && shape == PCB_SHAPE_TYPE::RECT ) ) )
{
const VECTOR2I lineVector( cursorPos - VECTOR2I( twoPointManager.GetOrigin() ) );
@ -1731,7 +1731,7 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool
graphic->SetLayer( drawingLayer );
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
VECTOR2I cursorPos = grid.BestSnapAnchor( m_controls->GetMousePosition(), graphic );
m_controls->ForceCursorPosition( true, cursorPos );
@ -1805,7 +1805,7 @@ bool DRAWING_TOOL::drawArc( const std::string& aTool, PCB_SHAPE** aGraphic, bool
else if( evt->IsMotion() )
{
// set angle snap
arcManager.SetAngleSnap( evt->Modifier( MD_CTRL ) );
arcManager.SetAngleSnap( evt->Modifier( MD_SHIFT ) );
// update, but don't step the manager state
arcManager.AddPoint( cursorPos, false );
@ -2040,14 +2040,14 @@ int DRAWING_TOOL::DrawZone( const TOOL_EVENT& aEvent )
LSET layers( m_frame->GetActiveLayer() );
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
VECTOR2I cursorPos = evt->HasPosition() ? evt->Position() : m_controls->GetMousePosition();
cursorPos = grid.BestSnapAnchor( cursorPos, layers );
m_controls->ForceCursorPosition( true, cursorPos );
if( ( sourceZone && sourceZone->GetHV45() ) || constrainAngle || evt->Modifier( MD_CTRL ) )
if( ( sourceZone && sourceZone->GetHV45() ) || constrainAngle || evt->Modifier( MD_SHIFT ) )
polyGeomMgr.SetLeaderMode( POLYGON_GEOM_MANAGER::LEADER_MODE::DEG45 );
else
polyGeomMgr.SetLeaderMode( POLYGON_GEOM_MANAGER::LEADER_MODE::DIRECT );

View File

@ -840,7 +840,7 @@ int EDIT_TOOL::doMoveSelection( TOOL_EVENT aEvent, bool aPickReference )
VECTOR2I movement;
editFrame->GetCanvas()->SetCurrentCursor( KICURSOR::MOVING );
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
if( evt->IsMotion() || evt->IsDrag( BUT_LEFT ) )
hasMouseMoved = true;

View File

@ -71,7 +71,7 @@ int PCB_PICKER_TOOL::Main( const TOOL_EVENT& aEvent )
if( m_snap )
{
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
cursorPos = grid.BestSnapAnchor( cursorPos, nullptr );
controls->ForceCursorPosition( true, cursorPos );
}

View File

@ -431,7 +431,7 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
while( TOOL_EVENT* evt = Wait() )
{
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( view->GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( view->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
if( !m_editPoints || evt->IsSelectionEvent() ||
evt->Matches( EVENTS::InhibitSelectionEditing ) )
@ -507,7 +507,7 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent )
}
// The alternative constraint limits to 45 degrees
bool enableAltConstraint = !!evt->Modifier( MD_CTRL );
bool enableAltConstraint = !!evt->Modifier( MD_SHIFT );
if( enableAltConstraint )
m_altConstraint->Apply();

View File

@ -236,7 +236,7 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
{
setCursor();
grid.SetSnap( !evt->Modifier( MD_SHIFT ) );
grid.SetUseGrid( view.GetGAL()->GetGridSnapping() && !evt->Modifier( MD_ALT ) );
grid.SetUseGrid( view.GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() );
const VECTOR2I cursorPos = grid.BestSnapAnchor( controls.GetMousePosition(), nullptr );
controls.ForceCursorPosition(true, cursorPos );
@ -297,7 +297,7 @@ int PCB_VIEWER_TOOLS::MeasureTool( const TOOL_EVENT& aEvent )
// move or drag when origin set updates rules
else if( originSet && ( evt->IsMotion() || evt->IsDrag( BUT_LEFT ) ) )
{
twoPtMgr.SetAngleSnap( evt->Modifier( MD_CTRL ) );
twoPtMgr.SetAngleSnap( evt->Modifier( MD_SHIFT ) );
twoPtMgr.SetEnd( cursorPos );
view.SetVisible( &ruler, true );