From 46d486118709900f4a3d92bc0c43f7528a6af42d Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 11 Nov 2022 14:47:28 +0500 Subject: [PATCH] Use the 45-degree limit button to apply alternative constraint. --- pcbnew/tools/pcb_point_editor.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index 9eefe915df..73ddc0776a 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -47,6 +47,7 @@ using namespace std::placeholders; #include #include #include +#include #include #include @@ -493,7 +494,7 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) updateEditedPoint( aEvent ); m_refill = false; bool inDrag = false; - bool lock45 = false; + bool useAltContraint = false; BOARD_COMMIT commit( editFrame ); @@ -503,6 +504,11 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) grid.SetSnap( !evt->Modifier( MD_SHIFT ) ); grid.SetUseGrid( getView()->GetGAL()->GetGridSnapping() && !evt->DisableGridSnapping() ); + if( editFrame->IsType( FRAME_PCB_EDITOR ) ) + useAltContraint = editFrame->GetPcbNewSettings()->m_Use45DegreeLimit; + else + useAltContraint = editFrame->GetFootprintEditorSettings()->m_Use45Limit; + if( !m_editPoints || evt->IsSelectionEvent() || evt->Matches( EVENTS::InhibitSelectionEditing ) ) { @@ -581,7 +587,7 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) m_editedPoint->SetPosition( pos ); // The alternative constraint limits to 45 degrees - if( lock45 ) + if( useAltContraint ) { m_altConstraint->Apply( grid ); } @@ -630,11 +636,6 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) m_refill = true; } - else if( evt->IsAction( &PCB_ACTIONS::toggleHV45Mode ) ) - { - lock45 = !lock45; - evt->SetPassEvent( false ); - } else if( evt->IsCancelInteractive() || evt->IsActivate() ) { if( inDrag ) // Restore the last change