Performance optimization for pad drawing.
Fixes https://gitlab.com/kicad/code/kicad/issues/12999
This commit is contained in:
parent
5fb191e4d6
commit
eb19e32b40
|
@ -52,6 +52,8 @@
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <macros.h>
|
#include <macros.h>
|
||||||
|
#include "kiface_base.h"
|
||||||
|
#include "pcbnew_settings.h"
|
||||||
|
|
||||||
using KIGFX::PCB_PAINTER;
|
using KIGFX::PCB_PAINTER;
|
||||||
using KIGFX::PCB_RENDER_SETTINGS;
|
using KIGFX::PCB_RENDER_SETTINGS;
|
||||||
|
@ -1435,12 +1437,14 @@ const BOX2I PAD::ViewBBox() const
|
||||||
int solderMaskMargin = std::max( GetSolderMaskExpansion(), 0 );
|
int solderMaskMargin = std::max( GetSolderMaskExpansion(), 0 );
|
||||||
VECTOR2I solderPasteMargin = VECTOR2D( GetSolderPasteMargin() );
|
VECTOR2I solderPasteMargin = VECTOR2D( GetSolderPasteMargin() );
|
||||||
BOX2I bbox = GetBoundingBox();
|
BOX2I bbox = GetBoundingBox();
|
||||||
|
|
||||||
// get the biggest possible clearance
|
|
||||||
int clearance = 0;
|
int clearance = 0;
|
||||||
|
|
||||||
for( PCB_LAYER_ID layer : GetLayerSet().Seq() )
|
// If we're drawing clearance lines then get the biggest possible clearance
|
||||||
clearance = std::max( clearance, GetOwnClearance( layer ) );
|
if( PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() ) )
|
||||||
|
{
|
||||||
|
if( cfg && cfg->m_Display.m_PadClearance && GetBoard() )
|
||||||
|
clearance = GetBoard()->GetDesignSettings().GetBiggestClearanceValue();
|
||||||
|
}
|
||||||
|
|
||||||
// Look for the biggest possible bounding box
|
// Look for the biggest possible bounding box
|
||||||
int xMargin = std::max( solderMaskMargin, solderPasteMargin.x ) + clearance;
|
int xMargin = std::max( solderMaskMargin, solderPasteMargin.x ) + clearance;
|
||||||
|
|
Loading…
Reference in New Issue