Browse Source

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
9.0
Seth Hillbrand 1 day ago
parent
commit
2d0c5dc8bd
  1. 15
      pcbnew/tools/pcb_point_editor.cpp

15
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<EDIT_POINT>*) 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 ) );
}

Loading…
Cancel
Save