genDrillMapFile: reduce the pen width used to plot oval shapes (better look)
This commit is contained in:
parent
ce672f926c
commit
37df47a3e7
|
@ -114,7 +114,7 @@ void PSLIKE_PLOTTER::FlashPadOval( const VECTOR2I& aPadPos, const VECTOR2I& aSiz
|
|||
if( aTraceMode == FILLED )
|
||||
ThickSegment( a + aPadPos, b + aPadPos, size.x, aTraceMode, nullptr );
|
||||
else
|
||||
sketchOval( aPadPos, size, orient, -1 );
|
||||
sketchOval( aPadPos, size, orient, USE_DEFAULT_LINE_WIDTH );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -55,9 +55,31 @@ inline double diameter_in_mm( double ius )
|
|||
|
||||
|
||||
// return a pen size to plot markers and having a readable shape
|
||||
inline int getMarkerBestPenSize( int aMarkerDiameter )
|
||||
// clamped to be >= MIN_SIZE_MM to avoid too small line width
|
||||
static int getMarkerBestPenSize( int aMarkerDiameter )
|
||||
{
|
||||
return aMarkerDiameter / 10;
|
||||
int bestsize = aMarkerDiameter / 10;
|
||||
|
||||
const double MIN_SIZE_MM = 0.1;
|
||||
bestsize = std::max( bestsize, pcbIUScale.mmToIU( MIN_SIZE_MM ) );
|
||||
|
||||
return bestsize;
|
||||
}
|
||||
|
||||
|
||||
// return a pen size to plot outlines for oval holes
|
||||
inline int getSketchOvalBestPenSize()
|
||||
{
|
||||
const double SKETCH_LINE_WIDTH_MM = 0.1;
|
||||
return pcbIUScale.mmToIU( SKETCH_LINE_WIDTH_MM );
|
||||
}
|
||||
|
||||
|
||||
// return a default pen size to plot items with no specific line thickness
|
||||
inline int getDefaultPenSize()
|
||||
{
|
||||
const double DEFAULT_LINE_WIDTH_MM = 0.2;
|
||||
return pcbIUScale.mmToIU( DEFAULT_LINE_WIDTH_MM );
|
||||
}
|
||||
|
||||
|
||||
|
@ -171,7 +193,7 @@ bool GENDRILL_WRITER_BASE::genDrillMapFile( const wxString& aFullFileName, PLOT_
|
|||
plotter->SetColorMode( false );
|
||||
|
||||
KIGFX::PCB_RENDER_SETTINGS renderSettings;
|
||||
renderSettings.SetDefaultPenWidth( pcbIUScale.mmToIU( 0.2 ) );
|
||||
renderSettings.SetDefaultPenWidth( getDefaultPenSize() );
|
||||
|
||||
plotter->SetRenderSettings( &renderSettings );
|
||||
|
||||
|
@ -476,7 +498,16 @@ bool GENDRILL_WRITER_BASE::plotDrillMarks( PLOTTER* aPlotter )
|
|||
aPlotter->Marker( pos, hole.m_Hole_Diameter, hole.m_Tool_Reference - 1 );
|
||||
|
||||
if( hole.m_Hole_Shape != 0 )
|
||||
{
|
||||
aPlotter->SetCurrentLineWidth( getSketchOvalBestPenSize() );
|
||||
// FlashPadOval uses also the render settings default pen size, so we need
|
||||
// to initialize it:
|
||||
KIGFX::RENDER_SETTINGS* renderSettings = aPlotter->RenderSettings();
|
||||
int curr_default_pensize = renderSettings->GetDefaultPenWidth();
|
||||
renderSettings->SetDefaultPenWidth( getSketchOvalBestPenSize() );
|
||||
aPlotter->FlashPadOval( pos, hole.m_Hole_Size, hole.m_Hole_Orient, SKETCH, nullptr );
|
||||
renderSettings->SetDefaultPenWidth( curr_default_pensize );
|
||||
}
|
||||
}
|
||||
|
||||
aPlotter->SetCurrentLineWidth( -1 );
|
||||
|
|
Loading…
Reference in New Issue