Fix a coding style issue.
This commit is contained in:
parent
7bda89cdf6
commit
4d28303e04
|
@ -40,9 +40,6 @@
|
||||||
#include <class_board.h>
|
#include <class_board.h>
|
||||||
#include <class_track.h>
|
#include <class_track.h>
|
||||||
|
|
||||||
#include <protos.h>
|
|
||||||
#include <pcbnew_id.h>
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function Join
|
* Function Join
|
||||||
|
@ -130,7 +127,7 @@ bool Project( wxPoint* aNearPos, wxPoint on_grid, const TRACK* track )
|
||||||
bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
||||||
wxPoint on_grid, wxPoint* curpos )
|
wxPoint on_grid, wxPoint* curpos )
|
||||||
{
|
{
|
||||||
bool doCheckNet = g_MagneticPadOption != capture_always && g_Drc_On;
|
bool doCheckNet = g_MagneticPadOption != CAPTURE_ALWAYS && g_Drc_On;
|
||||||
bool doTrack = false;
|
bool doTrack = false;
|
||||||
bool doPad = false;
|
bool doPad = false;
|
||||||
bool amMovingVia = false;
|
bool amMovingVia = false;
|
||||||
|
@ -156,15 +153,15 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
||||||
currTrack = NULL;
|
currTrack = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( g_MagneticPadOption == capture_always )
|
if( g_MagneticPadOption == CAPTURE_ALWAYS )
|
||||||
doPad = true;
|
doPad = true;
|
||||||
|
|
||||||
if( g_MagneticTrackOption == capture_always )
|
if( g_MagneticTrackOption == CAPTURE_ALWAYS )
|
||||||
doTrack = true;
|
doTrack = true;
|
||||||
|
|
||||||
if( aCurrentTool == ID_TRACK_BUTT || amMovingVia )
|
if( aCurrentTool == ID_TRACK_BUTT || amMovingVia )
|
||||||
{
|
{
|
||||||
int q = capture_cursor_in_track_tool;
|
int q = CAPTURE_CURSOR_IN_TRACK_TOOL;
|
||||||
|
|
||||||
if( g_MagneticPadOption == q )
|
if( g_MagneticPadOption == q )
|
||||||
doPad = true;
|
doPad = true;
|
||||||
|
@ -173,10 +170,7 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
||||||
doTrack = true;
|
doTrack = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// D(printf("doPad=%d doTrack=%d aCurrentTool=%d amMovingVia=%d\n", doPad, doTrack, aCurrentTool, amMovingVia );)
|
|
||||||
|
|
||||||
// The search precedence order is pads, then tracks/vias
|
// The search precedence order is pads, then tracks/vias
|
||||||
|
|
||||||
if( doPad )
|
if( doPad )
|
||||||
{
|
{
|
||||||
LSET layer_mask( screen->m_Active_Layer );
|
LSET layer_mask( screen->m_Active_Layer );
|
||||||
|
@ -220,11 +214,9 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
||||||
|
|
||||||
if( !track || track->Type() != PCB_TRACE_T )
|
if( !track || track->Type() != PCB_TRACE_T )
|
||||||
{
|
{
|
||||||
// D(printf("!currTrack and track=%p not found, layer_mask=0x%X\n", track, layer_mask );)
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// D( printf( "Project\n" ); )
|
|
||||||
return Project( curpos, on_grid, track );
|
return Project( curpos, on_grid, track );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,11 +251,8 @@ bool Magnetize( PCB_EDIT_FRAME* frame, int aCurrentTool, wxSize aGridSize,
|
||||||
if( !track->HitTest( *curpos ) )
|
if( !track->HitTest( *curpos ) )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// D(printf( "have track prospect\n");)
|
|
||||||
|
|
||||||
if( Join( curpos, track->GetStart(), track->GetEnd(), currTrack->GetStart(), currTrack->GetEnd() ) )
|
if( Join( curpos, track->GetStart(), track->GetEnd(), currTrack->GetStart(), currTrack->GetEnd() ) )
|
||||||
{
|
{
|
||||||
// D(printf( "join currTrack->Type()=%d\n", currTrack->Type() );)
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,8 @@ bool g_TwoSegmentTrackBuild = true;
|
||||||
|
|
||||||
LAYER_ID g_Route_Layer_TOP;
|
LAYER_ID g_Route_Layer_TOP;
|
||||||
LAYER_ID g_Route_Layer_BOTTOM;
|
LAYER_ID g_Route_Layer_BOTTOM;
|
||||||
int g_MagneticPadOption = capture_cursor_in_track_tool;
|
int g_MagneticPadOption = CAPTURE_CURSOR_IN_TRACK_TOOL;
|
||||||
int g_MagneticTrackOption = capture_cursor_in_track_tool;
|
int g_MagneticTrackOption = CAPTURE_CURSOR_IN_TRACK_TOOL;
|
||||||
|
|
||||||
wxPoint g_Offset_Module; // module offset used when moving a footprint
|
wxPoint g_Offset_Module; // module offset used when moving a footprint
|
||||||
|
|
||||||
|
|
|
@ -102,10 +102,11 @@ extern DLIST<TRACK> g_CurrentTrackList;
|
||||||
#define g_FirstTrackSegment g_CurrentTrackList.GetFirst() ///< first segment created
|
#define g_FirstTrackSegment g_CurrentTrackList.GetFirst() ///< first segment created
|
||||||
|
|
||||||
|
|
||||||
enum MagneticPadOptionValues {
|
enum MAGNETICPAD_OPTION_VALUES
|
||||||
no_effect,
|
{
|
||||||
capture_cursor_in_track_tool,
|
NO_EFFECT,
|
||||||
capture_always
|
CAPTURE_CURSOR_IN_TRACK_TOOL,
|
||||||
|
CAPTURE_ALWAYS
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue