Gerbview: fix incorrect initialization of WorldUnitLength.
Fix incorrect min zoom level to show D Code texts.
This commit is contained in:
parent
c016861962
commit
73b52f2e23
|
@ -46,6 +46,8 @@ GAL::GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions ) :
|
||||||
SetLookAtPoint( VECTOR2D( 0, 0 ) );
|
SetLookAtPoint( VECTOR2D( 0, 0 ) );
|
||||||
SetZoomFactor( 1.0 );
|
SetZoomFactor( 1.0 );
|
||||||
SetRotation( 0.0 );
|
SetRotation( 0.0 );
|
||||||
|
// this value for SetWorldUnitLength is only suitable for Pcbnew.
|
||||||
|
// Other editors/viewer must call SetWorldUnitLength with their internal units
|
||||||
SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
|
SetWorldUnitLength( 1e-9 /* 1 nm */ / 0.0254 /* 1 inch in meters */ );
|
||||||
// wxDC::GetPPI() reports 96 DPI, but somehow this value
|
// wxDC::GetPPI() reports 96 DPI, but somehow this value
|
||||||
// is the closest match to the legacy renderer
|
// is the closest match to the legacy renderer
|
||||||
|
|
|
@ -958,7 +958,7 @@ unsigned int GERBER_DRAW_ITEM::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) cons
|
||||||
|
|
||||||
// the level of details is chosen experimentally, to show
|
// the level of details is chosen experimentally, to show
|
||||||
// only a readable text:
|
// only a readable text:
|
||||||
const int level = Millimeter2iu( 500 );
|
const int level = Millimeter2iu( 4 );
|
||||||
return ( level / ( size + 1 ) );
|
return ( level / ( size + 1 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,7 @@ EDA_DRAW_PANEL_GAL( aParentWindow, aWindowId, aPosition, aSize, aOptions, aGalTy
|
||||||
{
|
{
|
||||||
m_view = new KIGFX::VIEW( true );
|
m_view = new KIGFX::VIEW( true );
|
||||||
m_view->SetGAL( m_gal );
|
m_view->SetGAL( m_gal );
|
||||||
|
GetGAL()->SetWorldUnitLength( 1.0/IU_PER_MM /* 10 nm */ / 25.4 /* 1 inch in mm */ );
|
||||||
|
|
||||||
m_painter.reset( new KIGFX::GERBVIEW_PAINTER( m_gal ) );
|
m_painter.reset( new KIGFX::GERBVIEW_PAINTER( m_gal ) );
|
||||||
m_view->SetPainter( m_painter.get() );
|
m_view->SetPainter( m_painter.get() );
|
||||||
|
@ -116,6 +117,9 @@ bool GERBVIEW_DRAW_PANEL_GAL::SwitchBackend( GAL_TYPE aGalType )
|
||||||
{
|
{
|
||||||
bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
|
bool rv = EDA_DRAW_PANEL_GAL::SwitchBackend( aGalType );
|
||||||
setDefaultLayerDeps();
|
setDefaultLayerDeps();
|
||||||
|
|
||||||
|
GetGAL()->SetWorldUnitLength( 1.0/IU_PER_MM /* 10 nm */ / 25.4 /* 1 inch in mm */ );
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -214,7 +214,7 @@ void GERBVIEW_PAINTER::draw( /*const*/ GERBER_DRAW_ITEM* aItem, int aLayer )
|
||||||
m_gal->SetIsFill( false );
|
m_gal->SetIsFill( false );
|
||||||
m_gal->SetStrokeColor( color );
|
m_gal->SetStrokeColor( color );
|
||||||
m_gal->SetFillColor( COLOR4D( 0, 0, 0, 0 ) );
|
m_gal->SetFillColor( COLOR4D( 0, 0, 0, 0 ) );
|
||||||
m_gal->SetLineWidth( 2 );
|
m_gal->SetLineWidth( textSize/10 );
|
||||||
m_gal->SetFontBold( false );
|
m_gal->SetFontBold( false );
|
||||||
m_gal->SetFontItalic( false );
|
m_gal->SetFontItalic( false );
|
||||||
m_gal->SetTextMirrored( false );
|
m_gal->SetTextMirrored( false );
|
||||||
|
|
|
@ -107,7 +107,7 @@ void GERBVIEW_PRINTOUT::setupViewLayers( const std::unique_ptr<KIGFX::VIEW>& aVi
|
||||||
void GERBVIEW_PRINTOUT::setupGal( KIGFX::GAL* aGal )
|
void GERBVIEW_PRINTOUT::setupGal( KIGFX::GAL* aGal )
|
||||||
{
|
{
|
||||||
BOARD_PRINTOUT::setupGal( aGal );
|
BOARD_PRINTOUT::setupGal( aGal );
|
||||||
aGal->SetWorldUnitLength( 10e-9 /* 10 nm */ / 0.0254 /* 1 inch in meters */ );
|
aGal->SetWorldUnitLength( 1.0/IU_PER_MM /* 10 nm */ / 25.4 /* 1 inch in mm */ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue