Plot solder mask layer: fix incorrect margin of zones drawn on this layer (zone areas were slighly larger than the actual areas)
Fix a few minor and very minor other issues: coverity warnings and compil warning.
This commit is contained in:
parent
75d02086ad
commit
4b4d9d9770
|
@ -90,6 +90,7 @@ void MARKER_BASE::init()
|
|||
MARKER_BASE::MARKER_BASE( const MARKER_BASE& aMarker )
|
||||
{
|
||||
m_Pos = aMarker.m_Pos;
|
||||
m_ErrorLevel = aMarker.m_ErrorLevel;
|
||||
m_MarkerType = aMarker.m_MarkerType;
|
||||
m_Color = aMarker.m_Color;
|
||||
m_ShapeBoundingBox = aMarker.m_ShapeBoundingBox;
|
||||
|
|
|
@ -254,8 +254,7 @@ public:
|
|||
{
|
||||
if( aIndex < 0 )
|
||||
aIndex += PointCount();
|
||||
|
||||
if( aIndex >= PointCount() )
|
||||
else if( aIndex >= PointCount() )
|
||||
aIndex -= PointCount();
|
||||
|
||||
return m_points[aIndex];
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
||||
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2012 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -108,7 +108,7 @@ void TEXTE_MODULE::Mirror( const wxPoint& aCentre, bool aMirrorAroundXAxis )
|
|||
// the mirror is around the Y axis or X axis if aMirrorAroundXAxis = true
|
||||
// the position is mirrored, but the text itself is not mirrored
|
||||
if( aMirrorAroundXAxis )
|
||||
MIRROR( m_Pos.x, aCentre.x );
|
||||
MIRROR( m_Pos.y, aCentre.y );
|
||||
else
|
||||
MIRROR( m_Pos.x, aCentre.x );
|
||||
NEGATE_AND_NORMALIZE_ANGLE_POS( m_Orient );
|
||||
|
|
|
@ -647,7 +647,9 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
|||
BRDITEMS_PLOTTER itemplotter( aPlotter, aBoard, aPlotOpt );
|
||||
itemplotter.SetLayerSet( aLayerMask );
|
||||
|
||||
// Plot edge layer and graphic items
|
||||
// Plot edge layer and graphic items
|
||||
// They do not have a solder Mask margin, because they are only graphic items
|
||||
// on this layer (like logos), not actually areas around pads.
|
||||
itemplotter.PlotBoardGraphicItems();
|
||||
|
||||
for( MODULE* module = aBoard->m_Modules; module; module = module->Next() )
|
||||
|
@ -677,8 +679,8 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
|||
// This extra margin is used to merge too close shapes
|
||||
// (distance < aMinThickness), and will be removed when creating
|
||||
// the actual shapes
|
||||
SHAPE_POLY_SET areas; // Contains shapes to plot
|
||||
SHAPE_POLY_SET initialPolys; // Contains exact shapes to plot
|
||||
SHAPE_POLY_SET areas; // Contains shapes to plot
|
||||
SHAPE_POLY_SET initialPolys; // Contains exact shapes to plot
|
||||
|
||||
/* calculates the coeff to compensate radius reduction of holes clearance
|
||||
* due to the segment approx ( 1 /cos( PI/circleToSegmentsCount )
|
||||
|
@ -736,7 +738,13 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
|||
}
|
||||
}
|
||||
|
||||
// Add filled zone areas
|
||||
// Add filled zone areas.
|
||||
#if 0 // Set to 1 if a solder mask margin must be applied to zones on solder mask
|
||||
int zone_margin = aBoard->GetDesignSettings().m_SolderMaskMargin;
|
||||
#else
|
||||
int zone_margin = 0;
|
||||
#endif
|
||||
|
||||
for( int ii = 0; ii < aBoard->GetAreaCount(); ii++ )
|
||||
{
|
||||
ZONE_CONTAINER* zone = aBoard->GetArea( ii );
|
||||
|
@ -745,9 +753,9 @@ void PlotSolderMaskLayer( BOARD *aBoard, PLOTTER* aPlotter,
|
|||
continue;
|
||||
|
||||
zone->TransformOutlinesShapeWithClearanceToPolygon( areas,
|
||||
inflate, true );
|
||||
inflate+zone_margin, false );
|
||||
zone->TransformOutlinesShapeWithClearanceToPolygon( initialPolys,
|
||||
0, true );
|
||||
zone_margin, false );
|
||||
}
|
||||
|
||||
// To avoid a lot of code, use a ZONE_CONTAINER
|
||||
|
|
|
@ -95,7 +95,8 @@ void PCB_EDIT_FRAME::InstallExchangeModuleFrame( MODULE* Module )
|
|||
{
|
||||
DIALOG_EXCHANGE_MODULE dialog( this, Module );
|
||||
|
||||
dialog.ShowQuasiModal();
|
||||
int ret = dialog.ShowQuasiModal();
|
||||
(void) ret; // make coverity quiet.
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ void ZONE_CONTAINER::TransformOutlinesShapeWithClearanceToPolygon(
|
|||
// add clearance to outline
|
||||
int clearance = aMinClearanceValue;
|
||||
|
||||
if( aUseNetClearance )
|
||||
if( aUseNetClearance && IsOnCopperLayer() )
|
||||
{
|
||||
clearance = GetClearance();
|
||||
if( aMinClearanceValue > clearance )
|
||||
|
|
|
@ -1097,7 +1097,8 @@ int gm_print( FILE* f, greymap_t* gm )
|
|||
}
|
||||
}
|
||||
|
||||
fputc( "*#=- "[5 * d / t], f ); /* what a cute trick :) */
|
||||
if( t )
|
||||
fputc( "*#=- "[5 * d / t], f ); /* what a cute trick :) */
|
||||
}
|
||||
|
||||
fputc( '\n', f );
|
||||
|
|
Loading…
Reference in New Issue