Commit 5951a7f9 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix an issue when collecting vias (for instance when left clicking on...

Pcbnew: fix an issue when collecting vias (for instance when left clicking on a via, it was not always detected)
This bug was mainly noticeable when using buried vias (some were never detected)
Minor other fixes (typos, strings hard to translate ...)
parent 7c0af1bf
......@@ -867,10 +867,6 @@ void EDGE_MODULE::Draw3D( EDA_3D_CANVAS* glcanvas )
// Draw 3D pads.
void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
{
int layer, nlmax;
bool Oncu, Oncmp, Both;
int color;
double scale = g_Parm_3D_Visu.m_BiuTo3Dunits;
// Calculate the center of the pad shape.
......@@ -932,10 +928,7 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
glNormal3f( 0.0, 0.0, 1.0 ); // Normal is Z axis
nlmax = g_Parm_3D_Visu.m_CopperLayersCount - 1;
Oncu = (m_layerMask & LAYER_BACK) ? true : false;
Oncmp = (m_layerMask & LAYER_FRONT) ? true : false;
Both = Oncu && Oncmp;
int nlmax = g_Parm_3D_Visu.m_CopperLayersCount - 1;
// Store here the points to approximate pad shape by segments
std::vector<CPolyPt> polyPadShape;
......@@ -943,26 +936,18 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
switch( GetShape() )
{
case PAD_CIRCLE:
for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
{
if( layer && (layer == nlmax) )
layer = LAYER_N_FRONT;
if( (layer == LAYER_N_FRONT) && !Oncmp )
continue;
if( (layer == LAYER_N_BACK) && !Oncu )
if( !IsOnLayer( layer ) )
continue;
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
continue;
color = g_ColorsSettings.GetLayerColor( layer );
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
continue;
SetGLColor( color );
SetGLColor( g_ColorsSettings.GetLayerColor( layer ) );
int zpos = g_Parm_3D_Visu.GetLayerZcoordBIU( layer );
int ring_radius = (m_Size.x + m_Drill.x) / 4;
if( thickness == 0 )
......@@ -1022,25 +1007,18 @@ void D_PAD::Draw3D( EDA_3D_CANVAS* glcanvas )
if( polyPadShape.size() )
{
for( layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
for( int layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; layer++ )
{
if( layer && (layer == nlmax) )
layer = LAYER_N_FRONT;
if( (layer == LAYER_N_FRONT) && !Oncmp )
continue;
if( (layer == LAYER_N_BACK) && !Oncu )
continue;
if( (layer > FIRST_COPPER_LAYER) && (layer < LAST_COPPER_LAYER) && !Both )
if( !IsOnLayer( layer ) )
continue;
if( g_Parm_3D_Visu.m_BoardSettings->IsLayerVisible( layer ) == false )
continue;
color = g_ColorsSettings.GetLayerColor( layer );
SetGLColor( color );
SetGLColor( g_ColorsSettings.GetLayerColor( layer ) );
if( thickness == 0 )
glNormal3f( 0.0, 0.0, Get3DLayer_Z_Orientation( layer ) );
......
......@@ -356,7 +356,7 @@ void EDA_BASE_FRAME::GetKicadHelp( wxCommandEvent& event )
}
else
{
msg.Printf( _( "Help file %s not found." ), GetChars( wxGetApp().GetHelpFileName() ) );
msg.Printf( _( "Help file %s could not be found." ), GetChars( wxGetApp().GetHelpFileName() ) );
wxMessageBox( msg );
}
......
......@@ -58,7 +58,7 @@ void DisplayInfoMessage( wxWindow* parent, const wxString& text, int displaytime
{
wxMessageDialog* dialog;
dialog = new wxMessageDialog( parent, text, _( "Info:" ),
dialog = new wxMessageDialog( parent, text, _( "Info" ),
wxOK | wxCENTRE | wxICON_INFORMATION );
dialog->ShowModal();
......
......@@ -27,6 +27,7 @@
#include <class_module.h>
#include <class_pad.h>
#include <class_track.h>
#include <class_marker_pcb.h>
......@@ -148,6 +149,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa
MODULE* module = NULL;
D_PAD* pad = NULL;
bool pad_through = false;
SEGVIA* via = NULL;
MARKER_PCB* marker = NULL;
#if 0 // debugging
......@@ -249,7 +251,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa
break;
case PCB_VIA_T:
case PCB_VIA_T: // vias are on many layers, so layer test is specific
via = (SEGVIA*) item;
break;
case PCB_TRACE_T:
......@@ -351,7 +354,8 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa
// Modules and their subcomponents: text and pads are not sensitive to the layer
// visibility controls. They all have their own separate visibility controls
if( module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
// for vias, GetLayer() has no meaning, but IsOnLayer() works fine
if( via || module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
{
if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
{
......@@ -378,7 +382,7 @@ SEARCH_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* testItem, const void* testDa
// Modules and their subcomponents: text and pads are not sensitive to the layer
// visibility controls. They all have their own separate visibility controls
if( module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
if( via || module || pad || m_Guide->IsLayerVisible( layer ) || !m_Guide->IgnoreNonVisibleLayers() )
{
if( !m_Guide->IsLayerLocked( layer ) || !m_Guide->IgnoreLockedLayers() )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment