Browse Source

PANEL_FP_EDITOR_FIELD_DEFAULTS: fix incorrect behavior.

One could not change the default layers for new fp texts

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20505
revert-0c36e162
jean-pierre charras 7 months ago
parent
commit
97e1c107c9
  1. 3
      pcbnew/dialogs/panel_fp_editor_field_defaults.cpp

3
pcbnew/dialogs/panel_fp_editor_field_defaults.cpp

@ -127,7 +127,8 @@ public:
long GetValueAsLong( int row, int col ) override { return m_items[row].m_Layer; }
void SetValueAsLong( int row, int col, long value ) override
{
if( col == 2 )
if( col == GetNumberCols() - 1 ) // only last column uses a long value
// (probably useless test)
m_items[row].m_Layer = static_cast<PCB_LAYER_ID>( value );
}

Loading…
Cancel
Save