PCBNEW_PRINTOUT: fix incorrect size of holes printed with the "small drill" option
Fixes #12880 https://gitlab.com/kicad/code/kicad/issues/12880
This commit is contained in:
parent
31bad5baaa
commit
90238dede8
|
@ -425,13 +425,14 @@ int PCB_PAINTER::getDrillShape( const PAD* aPad ) const
|
|||
}
|
||||
|
||||
|
||||
VECTOR2D PCB_PAINTER::getDrillSize( const PAD* aPad ) const
|
||||
SHAPE_SEGMENT PCB_PAINTER::getPadHoleShape( const PAD* aPad ) const
|
||||
{
|
||||
return VECTOR2D( aPad->GetDrillSize() );
|
||||
SHAPE_SEGMENT segm = *aPad->GetEffectiveHoleShape().get();
|
||||
return segm;
|
||||
}
|
||||
|
||||
|
||||
int PCB_PAINTER::getDrillSize( const PCB_VIA* aVia ) const
|
||||
int PCB_PAINTER::getViaDrillSize( const PCB_VIA* aVia ) const
|
||||
{
|
||||
return aVia->GetDrillValue();
|
||||
}
|
||||
|
@ -887,7 +888,7 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
|
||||
if( aLayer == LAYER_VIA_HOLEWALLS )
|
||||
{
|
||||
double radius = ( getDrillSize( aVia ) / 2.0 ) + m_holePlatingThickness;
|
||||
double radius = ( getViaDrillSize( aVia ) / 2.0 ) + m_holePlatingThickness;
|
||||
|
||||
if( !outline_mode )
|
||||
{
|
||||
|
@ -901,11 +902,11 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
{
|
||||
m_gal->SetIsStroke( false );
|
||||
m_gal->SetIsFill( true );
|
||||
m_gal->DrawCircle( center, getDrillSize( aVia ) / 2.0 );
|
||||
m_gal->DrawCircle( center, getViaDrillSize( aVia ) / 2.0 );
|
||||
}
|
||||
else if( aLayer == LAYER_VIA_THROUGH || m_pcbSettings.IsPrinting() )
|
||||
{
|
||||
int annular_width = ( aVia->GetWidth() - getDrillSize( aVia ) ) / 2.0;
|
||||
int annular_width = ( aVia->GetWidth() - getViaDrillSize( aVia ) ) / 2.0;
|
||||
double radius = aVia->GetWidth() / 2.0;
|
||||
bool draw = false;
|
||||
|
||||
|
@ -935,7 +936,7 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
}
|
||||
else if( aLayer == LAYER_VIA_BBLIND || aLayer == LAYER_VIA_MICROVIA )
|
||||
{
|
||||
int annular_width = ( aVia->GetWidth() - getDrillSize( aVia ) ) / 2.0;
|
||||
int annular_width = ( aVia->GetWidth() - getViaDrillSize( aVia ) ) / 2.0;
|
||||
double radius = aVia->GetWidth() / 2.0;
|
||||
|
||||
// Outer circles of blind/buried and micro-vias are drawn in a special way to indicate the
|
||||
|
@ -988,7 +989,7 @@ void PCB_PAINTER::draw( const PCB_VIA* aVia, int aLayer )
|
|||
if( aVia->FlashLayer( activeLayer ) )
|
||||
radius = aVia->GetWidth() / 2.0;
|
||||
else
|
||||
radius = getDrillSize( aVia ) / 2.0 + m_holePlatingThickness;
|
||||
radius = getViaDrillSize( aVia ) / 2.0 + m_holePlatingThickness;
|
||||
|
||||
m_gal->SetLineWidth( m_pcbSettings.m_outlineWidth );
|
||||
m_gal->SetIsFill( false );
|
||||
|
@ -1219,12 +1220,12 @@ void PCB_PAINTER::draw( const PAD* aPad, int aLayer )
|
|||
|
||||
if( aLayer == LAYER_PAD_PLATEDHOLES || aLayer == LAYER_NON_PLATEDHOLES )
|
||||
{
|
||||
std::shared_ptr<SHAPE_SEGMENT> slot = aPad->GetEffectiveHoleShape();
|
||||
SHAPE_SEGMENT slot = getPadHoleShape( aPad );
|
||||
|
||||
if( slot->GetSeg().A == slot->GetSeg().B ) // Circular hole
|
||||
m_gal->DrawCircle( slot->GetSeg().A, slot->GetWidth() / 2 );
|
||||
if( slot.GetSeg().A == slot.GetSeg().B ) // Circular hole
|
||||
m_gal->DrawCircle( slot.GetSeg().A, slot.GetWidth() / 2.0 );
|
||||
else
|
||||
m_gal->DrawSegment( slot->GetSeg().A, slot->GetSeg().B, slot->GetWidth() );
|
||||
m_gal->DrawSegment( slot.GetSeg().A, slot.GetSeg().B, slot.GetWidth() );
|
||||
}
|
||||
else if( m_pcbSettings.IsPrinting() )
|
||||
{
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include <pcb_display_options.h>
|
||||
#include <math/vector2d.h>
|
||||
#include <memory>
|
||||
#include <geometry/shape_segment.h>
|
||||
|
||||
|
||||
class EDA_ITEM;
|
||||
|
@ -201,14 +202,14 @@ protected:
|
|||
virtual int getDrillShape( const PAD* aPad ) const;
|
||||
|
||||
/**
|
||||
* Return drill size for a pad (internal units).
|
||||
* Return hole shape for a pad (internal units).
|
||||
*/
|
||||
virtual VECTOR2D getDrillSize( const PAD* aPad ) const;
|
||||
virtual SHAPE_SEGMENT getPadHoleShape( const PAD* aPad ) const;
|
||||
|
||||
/**
|
||||
* Return drill diameter for a via (internal units).
|
||||
*/
|
||||
virtual int getDrillSize( const PCB_VIA* aVia ) const;
|
||||
virtual int getViaDrillSize( const PCB_VIA* aVia ) const;
|
||||
|
||||
void strokeText( const wxString& aText, const VECTOR2I& aPosition,
|
||||
const TEXT_ATTRIBUTES& aAttrs );
|
||||
|
|
|
@ -32,6 +32,9 @@
|
|||
#include <pcbnew_settings.h>
|
||||
#include <view/view.h>
|
||||
#include <pcbplot.h>
|
||||
#include <geometry/shape_segment.h>
|
||||
#include <pad.h>
|
||||
|
||||
#include <advanced_config.h>
|
||||
|
||||
PCBNEW_PRINTOUT_SETTINGS::PCBNEW_PRINTOUT_SETTINGS( const PAGE_INFO& aPageInfo )
|
||||
|
@ -294,14 +297,23 @@ int KIGFX::PCB_PRINT_PAINTER::getDrillShape( const PAD* aPad ) const
|
|||
}
|
||||
|
||||
|
||||
VECTOR2D KIGFX::PCB_PRINT_PAINTER::getDrillSize( const PAD* aPad ) const
|
||||
SHAPE_SEGMENT KIGFX::PCB_PRINT_PAINTER::getPadHoleShape( const PAD* aPad ) const
|
||||
{
|
||||
return m_drillMarkReal ? KIGFX::PCB_PAINTER::getDrillSize( aPad )
|
||||
: VECTOR2D( m_drillMarkSize, m_drillMarkSize );
|
||||
SHAPE_SEGMENT segm;
|
||||
|
||||
if( m_drillMarkReal )
|
||||
segm = KIGFX::PCB_PAINTER::getPadHoleShape( aPad );
|
||||
else
|
||||
{
|
||||
segm = SHAPE_SEGMENT( aPad->GetPosition(),
|
||||
aPad->GetPosition(), m_drillMarkSize );
|
||||
}
|
||||
|
||||
return segm;
|
||||
}
|
||||
|
||||
|
||||
int KIGFX::PCB_PRINT_PAINTER::getDrillSize( const PCB_VIA* aVia ) const
|
||||
int KIGFX::PCB_PRINT_PAINTER::getViaDrillSize( const PCB_VIA* aVia ) const
|
||||
{
|
||||
return m_drillMarkReal ? KIGFX::PCB_PAINTER::getDrillSize( aVia ) : m_drillMarkSize;
|
||||
return m_drillMarkReal ? KIGFX::PCB_PAINTER::getViaDrillSize( aVia ) : m_drillMarkSize;
|
||||
}
|
||||
|
|
|
@ -100,9 +100,9 @@ public:
|
|||
protected:
|
||||
int getDrillShape( const PAD* aPad ) const override;
|
||||
|
||||
VECTOR2D getDrillSize( const PAD* aPad ) const override;
|
||||
SHAPE_SEGMENT getPadHoleShape( const PAD* aPad ) const override;
|
||||
|
||||
int getDrillSize( const PCB_VIA* aVia ) const override;
|
||||
int getViaDrillSize( const PCB_VIA* aVia ) const override;
|
||||
|
||||
///< Flag deciding whether use the actual hole size or user-specified size for drill marks
|
||||
bool m_drillMarkReal;
|
||||
|
|
Loading…
Reference in New Issue