Coverted Gerbview files to version in master so hotkey_rollover repo only contains changes for the hotkey fix

This commit is contained in:
Peter Montgomery 2020-06-25 22:43:29 +00:00 committed by Seth Hillbrand
parent 4ef02fd699
commit 19b7755ab7
1 changed files with 25 additions and 8 deletions

View File

@ -491,8 +491,11 @@ int PCB_EDITOR_CONTROL::TrackWidthInc( const TOOL_EVENT& aEvent )
{
int widthIndex = designSettings.GetTrackWidthIndex() + 1;
// If we go past the last track width entry in the list, start over at the beginning
if( widthIndex >= (int) designSettings.m_TrackWidthList.size() )
widthIndex = designSettings.m_TrackWidthList.size() - 1;
{
widthIndex = 0;
}
designSettings.SetTrackWidthIndex( widthIndex );
designSettings.UseCustomTrackViaSize( false );
@ -538,10 +541,16 @@ int PCB_EDITOR_CONTROL::TrackWidthDec( const TOOL_EVENT& aEvent )
}
else
{
int widthIndex = designSettings.GetTrackWidthIndex() - 1;
int widthIndex = 0; // Assume we only have a single track width entry
if( widthIndex < 0 )
widthIndex = 0;
// If there are more, cycle through them backwards
if( designSettings.m_TrackWidthList.size() > 0 )
{
widthIndex = designSettings.GetTrackWidthIndex() - 1;
// If we get to the lowest entry start over at the highest
if( widthIndex < 0 )
widthIndex = designSettings.m_TrackWidthList.size() - 1;
}
designSettings.SetTrackWidthIndex( widthIndex );
designSettings.UseCustomTrackViaSize( false );
@ -588,8 +597,9 @@ int PCB_EDITOR_CONTROL::ViaSizeInc( const TOOL_EVENT& aEvent )
{
int sizeIndex = designSettings.GetViaSizeIndex() + 1;
// If we go past the last via entry in the list, start over at the beginning
if( sizeIndex >= (int) designSettings.m_ViasDimensionsList.size() )
sizeIndex = designSettings.m_ViasDimensionsList.size() - 1;
sizeIndex = 0;
designSettings.SetViaSizeIndex( sizeIndex );
designSettings.UseCustomTrackViaSize( false );
@ -636,10 +646,17 @@ int PCB_EDITOR_CONTROL::ViaSizeDec( const TOOL_EVENT& aEvent )
}
else
{
int sizeIndex = designSettings.GetViaSizeIndex() - 1;
int sizeIndex = 0; // Assume we only have a single via size entry
if( sizeIndex < 0 )
sizeIndex = 0;
// If there are more, cycle through them backwards
if( designSettings.m_ViasDimensionsList.size() > 0 )
{
sizeIndex = designSettings.GetViaSizeIndex() - 1;
// If we get to the lowest entry start over at the highest
if( sizeIndex < 0 )
sizeIndex = designSettings.m_ViasDimensionsList.size() - 1;
}
designSettings.SetViaSizeIndex( sizeIndex );
designSettings.UseCustomTrackViaSize( false );