Commit 32db0d46 authored by Maciej Suminski's avatar Maciej Suminski

Dynamic font scaling for pads netnames.

parent b7747bc2
......@@ -374,12 +374,14 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
if( aLayer == ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ) )
{
size = VECTOR2D( aPad->GetSize() / 2 );
double scale = m_gal->GetZoomFactor();
double maxSize = PCB_RENDER_SETTINGS::MAX_FONT_SIZE / scale;
// Font size limits
if( size.x > PCB_RENDER_SETTINGS::MAX_FONT_SIZE )
size.x = PCB_RENDER_SETTINGS::MAX_FONT_SIZE;
if( size.y > PCB_RENDER_SETTINGS::MAX_FONT_SIZE )
size.y = PCB_RENDER_SETTINGS::MAX_FONT_SIZE;
if( size.x > maxSize )
size.x = maxSize;
if( size.y > maxSize )
size.y = maxSize;
// Keep the size ratio for the font, but make it smaller
if( size.x < size.y )
......
......@@ -105,7 +105,7 @@ protected:
bool m_visibleLayers [NB_LAYERS];
bool m_visibleItems [END_PCB_VISIBLE_LIST];
static const double MAX_FONT_SIZE = 1500000;
static const double MAX_FONT_SIZE = 100000000;
DisplayZonesMode m_displayZoneMode;
};
......
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