From 2d0c5dc8bd6d3c2c47cbdf1775ee95e8db94099c Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sun, 5 Oct 2025 06:52:27 -0700 Subject: [PATCH] Only constrain points based on settings There was a false fall-through that caught all points for polygons. Now, constraint is applied only based on the user keys and settings Fixes https://gitlab.com/kicad/code/kicad/issues/21897 --- pcbnew/tools/pcb_point_editor.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pcbnew/tools/pcb_point_editor.cpp b/pcbnew/tools/pcb_point_editor.cpp index 0bf44111d1..2b76e747e9 100644 --- a/pcbnew/tools/pcb_point_editor.cpp +++ b/pcbnew/tools/pcb_point_editor.cpp @@ -2264,7 +2264,6 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) if( m_editedPoint->GetGridConstraint() != SNAP_BY_GRID ) grid.SetAuxAxes( true, m_original.GetPosition() ); - setAltConstraint( true ); m_editedPoint->SetActive(); for( size_t ii = 0; ii < m_editPoints->PointsSize(); ++ii ) @@ -2320,6 +2319,17 @@ int PCB_POINT_EDITOR::OnSelectionChange( const TOOL_EVENT& aEvent ) } } + // Update constraint based on modifier keys and settings + bool constraintEnabled = false; + + if( editFrame->IsType( FRAME_PCB_EDITOR ) ) + constraintEnabled = editFrame->GetPcbNewSettings()->m_Use45DegreeLimit; + else + constraintEnabled = editFrame->GetFootprintEditorSettings()->m_Use45Limit; + + constraintEnabled = constraintEnabled && !evt->Modifier( MD_CTRL ); + setAltConstraint( constraintEnabled ); + // Apply 45 degree or other constraints if( m_altConstraint ) { @@ -2630,9 +2640,10 @@ void PCB_POINT_EDITOR::setAltConstraint( bool aEnabled ) EC_CONVERGING* altConstraint = new EC_CONVERGING( *line, *m_editPoints ); m_altConstraint.reset( (EDIT_CONSTRAINT*) altConstraint ); } - else + else if( !isPoly ) { // Find a proper constraining point for 45 degrees mode + // Don't constrain polygon points m_altConstrainer = get45DegConstrainer(); m_altConstraint.reset( new EC_45DEGREE( *m_editedPoint, m_altConstrainer ) ); }