Change pin on grid test in symbol editor.
The pin on grid test always used a fixed grid spacing of 25 mils. The change uses the current grid setting for the on grid test. Grid sizes below 25 mils are clamped to 25 mils to prevent issues when connecting wires to pins in the schematic editor. Fixes lp:1817896 https://bugs.launchpad.net/kicad/+bug/1817896
This commit is contained in:
parent
a391e5a236
commit
71a62bb782
|
@ -594,7 +594,10 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
|
||||||
if( !part )
|
if( !part )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int MIN_GRID_SIZE = 25;
|
wxRealPoint curr_grid_size = GetScreen()->GetGridSize();
|
||||||
|
const int min_grid_size = 25;
|
||||||
|
const int grid_size = KiROUND( curr_grid_size.x );
|
||||||
|
const int clamped_grid_size = ( grid_size < min_grid_size ) ? min_grid_size : grid_size;
|
||||||
|
|
||||||
LIB_PINS pinList;
|
LIB_PINS pinList;
|
||||||
|
|
||||||
|
@ -672,8 +675,8 @@ void LIB_EDIT_FRAME::OnCheckComponent( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
LIB_PIN* pin = pinList[ii];
|
LIB_PIN* pin = pinList[ii];
|
||||||
|
|
||||||
if( ( (pin->GetPosition().x % MIN_GRID_SIZE) == 0 ) &&
|
if( ( (pin->GetPosition().x % clamped_grid_size) == 0 ) &&
|
||||||
( (pin->GetPosition().y % MIN_GRID_SIZE) == 0 ) )
|
( (pin->GetPosition().y % clamped_grid_size) == 0 ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// "pin" is off grid here.
|
// "pin" is off grid here.
|
||||||
|
|
Loading…
Reference in New Issue