7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-19 18:51:40 +00:00

feature removal: remove Show Hidden Text

Does not work properly since 8.0 introduction of footprint fields.

Fixes: https://gitlab.com/kicad/code/kicad/-/issues/18656
This commit is contained in:
Mike Williams 2024-09-11 09:53:26 -04:00
parent 32f84da9a2
commit 867cb58175
50 changed files with 79 additions and 146 deletions

View File

@ -347,7 +347,7 @@ void BOARD_ADAPTER::InitSettings( REPORTER* aStatusReporter, REPORTER* aWarningR
BOX2I bbbox;
if( m_board )
bbbox = m_board->ComputeBoundingBox( !m_board->IsFootprintHolder() && haveOutline, false );
bbbox = m_board->ComputeBoundingBox( !m_board->IsFootprintHolder() && haveOutline );
// Gives a non null size to avoid issues in zoom / scale calculations
if( ( bbbox.GetWidth() == 0 ) && ( bbbox.GetHeight() == 0 ) )

View File

@ -168,7 +168,6 @@ wxString LayerName( int aLayer )
case LAYER_FP_VALUES: return _( "Values" );
case LAYER_FP_REFERENCES: return _( "Reference designators" );
case LAYER_FP_TEXT: return _( "Footprint text" );
case LAYER_HIDDEN_TEXT: return _( "Hidden text" );
case LAYER_PADS_SMD_FR: return _( "SMD pads front" );
case LAYER_PADS_SMD_BK: return _( "SMD pads back" );
case LAYER_PADS_TH: return _( "Through-hole pads" );

View File

@ -840,7 +840,7 @@ GAL_SET GAL_SET::DefaultVisible()
LAYER_VIA_MICROVIA,
LAYER_VIA_BBLIND,
LAYER_VIA_THROUGH,
// LAYER_HIDDEN_TEXT, // Invisible text hidden by default
// LAYER_HIDDEN_TEXT, // DEPCREATED SINCE 9.0. Invisible text hidden by default
LAYER_ANCHOR,
LAYER_PADS_SMD_FR,
LAYER_PADS_SMD_BK,

View File

@ -161,7 +161,6 @@ static const std::map<int, COLOR4D> s_defaultTheme =
{ LAYER_DRC_ERROR, CSS_COLOR( 215, 91, 107, 0.8 ) },
{ LAYER_DRC_WARNING, CSS_COLOR( 255, 208, 66, 0.8 ) },
{ LAYER_DRC_EXCLUSION, CSS_COLOR( 255, 255, 255, 0.8 ) },
{ LAYER_HIDDEN_TEXT, CSS_COLOR( 132, 132, 132, 1 ) },
{ LAYER_GRID, CSS_COLOR( 132, 132, 132, 1 ) },
{ LAYER_GRID_AXES, CSS_COLOR( 194, 194, 194, 1 ) },
{ LAYER_PAD_PLATEDHOLES, CSS_COLOR( 194, 194, 0, 1 ) },
@ -383,7 +382,6 @@ static const std::map<int, COLOR4D> s_classicTheme =
{ LAYER_DRC_ERROR, COLOR4D( PURERED ).WithAlpha( 0.8 ) },
{ LAYER_DRC_WARNING, COLOR4D( PUREGREEN ).WithAlpha( 0.8 ) },
{ LAYER_DRC_EXCLUSION, COLOR4D( WHITE ) },
{ LAYER_HIDDEN_TEXT, COLOR4D( LIGHTGRAY ) },
{ LAYER_GRID, COLOR4D( DARKGRAY ) },
{ LAYER_GRID_AXES, COLOR4D( BLUE ) },
{ LAYER_PAD_PLATEDHOLES, COLOR4D( YELLOW ) },

View File

@ -123,7 +123,6 @@ COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath )
CLR( "board.drc_error", LAYER_DRC_ERROR );
CLR( "board.drc_warning", LAYER_DRC_WARNING );
CLR( "board.drc_exclusion", LAYER_DRC_EXCLUSION );
CLR( "board.footprint_text_invisible", LAYER_HIDDEN_TEXT );
CLR( "board.grid", LAYER_GRID );
CLR( "board.grid_axes", LAYER_GRID_AXES );
CLR( "board.pad_plated_hole", LAYER_PAD_PLATEDHOLES );

View File

@ -131,7 +131,7 @@ VECTOR2I SELECTION::GetCenter() const
}
BOX2I SELECTION::GetBoundingBox( bool aOnlyVisible ) const
BOX2I SELECTION::GetBoundingBox() const
{
BOX2I bbox;

View File

@ -82,7 +82,7 @@ EDA_ITEM* EE_SELECTION::GetTopLeftItem( bool onlyModules ) const
}
BOX2I EE_SELECTION::GetBoundingBox( bool aOnlyVisible ) const
BOX2I EE_SELECTION::GetBoundingBox() const
{
BOX2I bbox;

View File

@ -46,7 +46,7 @@ public:
EDA_ITEM* GetTopLeftItem( bool onlyModules = false ) const override;
BOX2I GetBoundingBox( bool aOnlyVisible = false ) const override;
BOX2I GetBoundingBox() const override;
void SetScreen( SCH_SCREEN* aScreen ) { m_screen = aScreen; }
SCH_SCREEN* GetScreen() { return m_screen; }

View File

@ -199,7 +199,7 @@ enum GAL_LAYER_ID: int
LAYER_NON_PLATEDHOLES = GAL_LAYER_ID_START + 4, ///< handle color for not plated holes (holes, not pads)
LAYER_FP_TEXT = GAL_LAYER_ID_START + 5,
// LAYER_MOD_TEXT_BK deprecated + 6,
LAYER_HIDDEN_TEXT = GAL_LAYER_ID_START + 7, ///< text marked as invisible
// LAYER_HIDDEN_TEXT = GAL_LAYER_ID_START + 7, ///< DEPRECATED, UNUSED SINCE 9.0. text marked as invisible
LAYER_ANCHOR = GAL_LAYER_ID_START + 8, ///< anchor of items having an anchor point (texts, footprints)
LAYER_PADS_SMD_FR = GAL_LAYER_ID_START + 9, ///< smd pads, front layer
LAYER_PADS_SMD_BK = GAL_LAYER_ID_START + 10, ///< smd pads, back layer

View File

@ -154,7 +154,7 @@ public:
return GetBoundingBox().GetPosition();
}
virtual BOX2I GetBoundingBox( bool aOnlyVisible = false ) const;
virtual BOX2I GetBoundingBox() const;
virtual EDA_ITEM* GetTopLeftItem( bool onlyModules = false ) const
{

View File

@ -511,7 +511,7 @@ int AR_AUTOPLACER::testFootprintOnBoard( FOOTPRINT* aFootprint, bool TstOtherSid
side = AR_SIDE_BOTTOM; otherside = AR_SIDE_TOP;
}
BOX2I fpBBox = aFootprint->GetBoundingBox( false, false );
BOX2I fpBBox = aFootprint->GetBoundingBox( false );
fpBBox.Move( -1*aOffset );
buildFpAreas( aFootprint, 0 );
@ -548,7 +548,7 @@ int AR_AUTOPLACER::getOptimalFPPlacement( FOOTPRINT* aFootprint )
lastPosOK = m_matrix.m_BrdBox.GetOrigin();
VECTOR2I fpPos = aFootprint->GetPosition();
BOX2I fpBBox = aFootprint->GetBoundingBox( false, false );
BOX2I fpBBox = aFootprint->GetBoundingBox( false );
// Move fpBBox to have the footprint position at (0,0)
fpBBox.Move( -fpPos );

View File

@ -137,7 +137,7 @@ void SpreadFootprints( std::vector<FOOTPRINT*>* aFootprints, VECTOR2I aTargetBox
wxString path =
aGroupBySheet ? footprint->GetPath().AsString().BeforeLast( '/' ) : wxString( wxS( "" ) );
VECTOR2I size = footprint->GetBoundingBox( false, false ).GetSize();
VECTOR2I size = footprint->GetBoundingBox( false ).GetSize();
size.x += aComponentGap;
size.y += aComponentGap;
@ -212,10 +212,10 @@ void SpreadFootprints( std::vector<FOOTPRINT*>* aFootprints, VECTOR2I aTargetBox
position.y += fpSize.y * ( i / optimalCountPerLine );
}
BOX2I old_fp_bbox = footprint->GetBoundingBox( false, false );
BOX2I old_fp_bbox = footprint->GetBoundingBox( false );
footprint->Move( position - old_fp_bbox.GetOrigin() );
BOX2I new_fp_bbox = footprint->GetBoundingBox( false, false );
BOX2I new_fp_bbox = footprint->GetBoundingBox( false );
new_fp_bbox.Inflate( aComponentGap / 2 );
block_bbox.Merge( new_fp_bbox );
}
@ -262,7 +262,7 @@ void SpreadFootprints( std::vector<FOOTPRINT*>* aFootprints, VECTOR2I aTargetBox
for( FOOTPRINT* footprint : footprints )
{
footprint->Move( target_pos - src_bbox.GetPosition() );
sheet_bbox.Merge( footprint->GetBoundingBox( false, false ) );
sheet_bbox.Merge( footprint->GetBoundingBox( false ) );
}
block_i++;

View File

@ -1652,7 +1652,7 @@ unsigned BOARD::GetNodesCount( int aNet ) const
}
BOX2I BOARD::ComputeBoundingBox( bool aBoardEdgesOnly, bool aIncludeHiddenText ) const
BOX2I BOARD::ComputeBoundingBox( bool aBoardEdgesOnly ) const
{
BOX2I bbox;
LSET visible = GetVisibleLayers();
@ -1688,7 +1688,7 @@ BOX2I BOARD::ComputeBoundingBox( bool aBoardEdgesOnly, bool aIncludeHiddenText )
}
else if( ( footprint->GetLayerSet() & visible ).any() )
{
bbox.Merge( footprint->GetBoundingBox( true, aIncludeHiddenText ) );
bbox.Merge( footprint->GetBoundingBox( true ) );
}
}
@ -2390,7 +2390,7 @@ FOOTPRINT* BOARD::GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveL
// Filter non visible footprints if requested
if( !aVisibleOnly || IsFootprintLayerVisible( layer ) )
{
BOX2I bb = candidate->GetBoundingBox( false, false );
BOX2I bb = candidate->GetBoundingBox( false );
int offx = bb.GetX() + bb.GetWidth() / 2;
int offy = bb.GetY() + bb.GetHeight() / 2;

View File

@ -903,11 +903,11 @@ public:
* @param aBoardEdgesOnly is true if we are interested in board edge segments only.
* @return the board's bounding box.
*/
BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false, bool aIncludeHiddenText = false ) const;
BOX2I ComputeBoundingBox( bool aBoardEdgesOnly = false ) const;
const BOX2I GetBoundingBox() const override
{
return ComputeBoundingBox( false, IsElementVisible( LAYER_HIDDEN_TEXT ) );
return ComputeBoundingBox( false );
}
/**
@ -921,7 +921,7 @@ public:
*/
const BOX2I GetBoardEdgesBoundingBox() const
{
return ComputeBoundingBox( true, false );
return ComputeBoundingBox( true );
}
void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList ) override;

View File

@ -236,11 +236,8 @@ INSPECT_RESULT GENERAL_COLLECTOR::Inspect( EDA_ITEM* aTestItem, void* aTestData
{
PCB_LAYER_ID layer = text->GetLayer();
if( m_Guide->IgnoreHiddenFPText() )
{
if( !text->IsVisible() )
return INSPECT_RESULT::CONTINUE;
}
if( !text->IsVisible() )
return INSPECT_RESULT::CONTINUE;
if( m_Guide->IgnoreFPTextOnBack() && IsBackLayer( layer ) )
return INSPECT_RESULT::CONTINUE;

View File

@ -77,11 +77,6 @@ public:
*/
virtual bool IncludeSecondary() const = 0;
/**
* @return true if footprint texts marked as "no show" should be ignored.
*/
virtual bool IgnoreHiddenFPText() const = 0;
/**
* @return true if should ignore footprint text on back layers
*/
@ -347,7 +342,6 @@ public:
m_includeSecondary = true;
#endif
m_ignoreHiddenFPText = true; // g_ModuleTextNOVColor;
m_ignoreFPTextOnBack = true;
m_ignoreFPTextOnFront = false;
m_ignoreFootprintsOnBack = true; // !Show_footprints_Cmp;
@ -403,12 +397,6 @@ public:
bool IncludeSecondary() const override { return m_includeSecondary; }
void SetIncludeSecondary( bool include ) { m_includeSecondary = include; }
/**
* @return true if Fooptrint Text marked as "no show" should be ignored.
*/
bool IgnoreHiddenFPText() const override { return m_ignoreHiddenFPText; }
void SetIgnoreHiddenFPText( bool ignore ) { m_ignoreHiddenFPText = ignore; }
/**
* @return true if should ignore Footprint Text on back layers
*/
@ -494,7 +482,6 @@ private:
bool m_ignoreLockedItems;
bool m_includeSecondary;
bool m_ignoreHiddenFPText;
bool m_ignoreFPTextOnBack;
bool m_ignoreFPTextOnFront;
bool m_ignoreFootprintsOnBack;

View File

@ -811,7 +811,7 @@ bool BuildBoardPolygonOutlines( BOARD* aBoard, SHAPE_POLY_SET& aOutlines, int aE
// If null area, uses the global bounding box.
if( ( bbbox.GetWidth() ) == 0 || ( bbbox.GetHeight() == 0 ) )
bbbox = aBoard->ComputeBoundingBox( false, false );
bbbox = aBoard->ComputeBoundingBox( false );
// Ensure non null area. If happen, gives a minimal size.
if( ( bbbox.GetWidth() ) == 0 || ( bbbox.GetHeight() == 0 ) )
@ -871,7 +871,7 @@ void buildBoardBoundingBoxPoly( const BOARD* aBoard, SHAPE_POLY_SET& aOutline )
// If null area, uses the global bounding box.
if( ( bbbox.GetWidth() ) == 0 || ( bbbox.GetHeight() == 0 ) )
bbbox = aBoard->ComputeBoundingBox( false, false );
bbbox = aBoard->ComputeBoundingBox( false );
// Ensure non null area. If happen, gives a minimal size.
if( ( bbbox.GetWidth() ) == 0 || ( bbbox.GetHeight() == 0 ) )

View File

@ -189,7 +189,7 @@ void PCB_EDIT_FRAME::ExecuteRemoteCommand( const char* cmdline )
if( footprint )
{
bbox = footprint->GetBoundingBox( true, false ); // No invisible text in bbox calc
bbox = footprint->GetBoundingBox( true );
if( pad )
m_toolManager->RunAction<BOARD_ITEM*>( PCB_ACTIONS::highlightItem, pad );

View File

@ -650,7 +650,7 @@ void DIALOG_EXPORT_STEP::onExportButton( wxCommandEvent& aEvent )
case STEP_ORIGIN_BOARD_CENTER:
{
BOX2I bbox = m_editFrame->GetBoard()->ComputeBoundingBox( true, false );
BOX2I bbox = m_editFrame->GetBoard()->ComputeBoundingBox( true );
double xOrg = pcbIUScale.IUTomm( bbox.GetCenter().x );
double yOrg = pcbIUScale.IUTomm( bbox.GetCenter().y );
LOCALE_IO dummy;
@ -691,4 +691,4 @@ double DIALOG_EXPORT_STEP::GetXOrg() const
double DIALOG_EXPORT_STEP::GetYOrg()
{
return EDA_UNIT_UTILS::UI::DoubleValueFromString( m_STEP_Yorg->GetValue() );
}
}

View File

@ -189,7 +189,7 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
{
// Origin = board center:
BOARD* pcb = GetBoard();
BOX2I bbox = pcb->ComputeBoundingBox( true, false );
BOX2I bbox = pcb->ComputeBoundingBox( true );
aXRef = pcbIUScale.IUTomm( bbox.GetCenter().x );
aYRef = pcbIUScale.IUTomm( bbox.GetCenter().y );
}
@ -227,4 +227,4 @@ void PCB_EDIT_FRAME::OnExportVRML( wxCommandEvent& event )
DisplayErrorMessage( this, msg );
return;
}
}
}

View File

@ -39,7 +39,7 @@ void DRC_INTERACTIVE_COURTYARD_CLEARANCE::testCourtyardClearances()
{
FOOTPRINT* fpB = m_FpInMove[i];
BOX2I bbox = fpB->GetBoundingBox( true, false );
BOX2I bbox = fpB->GetBoundingBox( true );
movingBBox.Merge( bbox );
fpBBBoxes[i] = bbox;
}
@ -51,7 +51,7 @@ void DRC_INTERACTIVE_COURTYARD_CLEARANCE::testCourtyardClearances()
if( fpA->IsSelected() )
continue;
BOX2I fpABBox = fpA->GetBoundingBox( true, false );
BOX2I fpABBox = fpA->GetBoundingBox( true );
if( !movingBBox.Intersects( fpABBox ) )
continue;

View File

@ -168,7 +168,7 @@ bool GENCAD_EXPORTER::WriteFile( wxString& aFullFileName )
BOARD* pcb = m_board;
// Update some board data, to ensure a reliable gencad export
pcb->ComputeBoundingBox( false, false );
pcb->ComputeBoundingBox( false );
/* Temporary modification of footprints that are flipped (i.e. on bottom
* layer) to convert them to non flipped footprints.

View File

@ -72,7 +72,7 @@ bool EXPORT_SVG::Plot( BOARD* aBoard, const PCB_PLOT_SVG_OPTIONS& aSvgPlotOption
if( aSvgPlotOptions.m_pageSizeMode == 2 ) // Page is board boundary size
{
BOX2I bbox = aBoard->ComputeBoundingBox( false, false );
BOX2I bbox = aBoard->ComputeBoundingBox( false );
PAGE_INFO currpageInfo = aBoard->GetPageSettings();
currpageInfo.SetWidthMils( bbox.GetWidth() / pcbIUScale.IU_PER_MILS );

View File

@ -309,7 +309,7 @@ std::string PLACE_FILE_EXPORTER::GenReportData()
buffer += "\n$BeginDESCRIPTION\n";
BOX2I bbbox = m_board->ComputeBoundingBox( false, false );
BOX2I bbbox = m_board->ComputeBoundingBox( false );
buffer += "\n$BOARD\n";

View File

@ -69,7 +69,6 @@
FOOTPRINT::FOOTPRINT( BOARD* parent ) :
BOARD_ITEM_CONTAINER((BOARD_ITEM*) parent, PCB_FOOTPRINT_T ),
m_boundingBoxCacheTimeStamp( 0 ),
m_visibleBBoxCacheTimeStamp( 0 ),
m_textExcludedBBoxCacheTimeStamp( 0 ),
m_hullCacheTimeStamp( 0 ),
m_initial_comments( nullptr )
@ -127,8 +126,6 @@ FOOTPRINT::FOOTPRINT( const FOOTPRINT& aFootprint ) :
m_cachedBoundingBox = aFootprint.m_cachedBoundingBox;
m_boundingBoxCacheTimeStamp = aFootprint.m_boundingBoxCacheTimeStamp;
m_cachedVisibleBBox = aFootprint.m_cachedVisibleBBox;
m_visibleBBoxCacheTimeStamp = aFootprint.m_visibleBBoxCacheTimeStamp;
m_cachedTextExcludedBBox = aFootprint.m_cachedTextExcludedBBox;
m_textExcludedBBoxCacheTimeStamp = aFootprint.m_textExcludedBBoxCacheTimeStamp;
m_cachedHull = aFootprint.m_cachedHull;
@ -700,8 +697,6 @@ FOOTPRINT& FOOTPRINT::operator=( FOOTPRINT&& aOther )
m_cachedBoundingBox = aOther.m_cachedBoundingBox;
m_boundingBoxCacheTimeStamp = aOther.m_boundingBoxCacheTimeStamp;
m_cachedVisibleBBox = aOther.m_cachedVisibleBBox;
m_visibleBBoxCacheTimeStamp = aOther.m_visibleBBoxCacheTimeStamp;
m_cachedTextExcludedBBox = aOther.m_cachedTextExcludedBBox;
m_textExcludedBBoxCacheTimeStamp = aOther.m_textExcludedBBoxCacheTimeStamp;
m_cachedHull = aOther.m_cachedHull;
@ -794,8 +789,6 @@ FOOTPRINT& FOOTPRINT::operator=( const FOOTPRINT& aOther )
m_cachedBoundingBox = aOther.m_cachedBoundingBox;
m_boundingBoxCacheTimeStamp = aOther.m_boundingBoxCacheTimeStamp;
m_cachedVisibleBBox = aOther.m_cachedVisibleBBox;
m_visibleBBoxCacheTimeStamp = aOther.m_visibleBBoxCacheTimeStamp;
m_cachedTextExcludedBBox = aOther.m_cachedTextExcludedBBox;
m_textExcludedBBoxCacheTimeStamp = aOther.m_textExcludedBBoxCacheTimeStamp;
m_cachedHull = aOther.m_cachedHull;
@ -1137,7 +1130,7 @@ void FOOTPRINT::Remove( BOARD_ITEM* aBoardItem, REMOVE_MODE aMode )
double FOOTPRINT::GetArea( int aPadding ) const
{
BOX2I bbox = GetBoundingBox( false, false );
BOX2I bbox = GetBoundingBox( false );
double w = std::abs( static_cast<double>( bbox.GetWidth() ) ) + aPadding;
double h = std::abs( static_cast<double>( bbox.GetHeight() ) ) + aPadding;
@ -1252,26 +1245,21 @@ bool FOOTPRINT::TextOnly() const
const BOX2I FOOTPRINT::GetBoundingBox() const
{
return GetBoundingBox( true, true );
return GetBoundingBox( true );
}
const BOX2I FOOTPRINT::GetBoundingBox( bool aIncludeText, bool aIncludeInvisibleText ) const
const BOX2I FOOTPRINT::GetBoundingBox( bool aIncludeText ) const
{
const BOARD* board = GetBoard();
if( board )
{
if( aIncludeText && aIncludeInvisibleText )
if( aIncludeText )
{
if( m_boundingBoxCacheTimeStamp >= board->GetTimeStamp() )
return m_cachedBoundingBox;
}
else if( aIncludeText )
{
if( m_visibleBBoxCacheTimeStamp >= board->GetTimeStamp() )
return m_cachedVisibleBBox;
}
else
{
if( m_textExcludedBBoxCacheTimeStamp >= board->GetTimeStamp() )
@ -1347,7 +1335,7 @@ const BOX2I FOOTPRINT::GetBoundingBox( bool aIncludeText, bool aIncludeInvisible
if( !isFPEdit && m_privateLayers.test( text->GetLayer() ) )
continue;
if( aIncludeInvisibleText || text->IsVisible() )
if( text->IsVisible() )
bbox.Merge( text->GetBoundingBox() );
}
@ -1372,16 +1360,12 @@ const BOX2I FOOTPRINT::GetBoundingBox( bool aIncludeText, bool aIncludeInvisible
}
if( ( Value().IsVisible() && valueLayerIsVisible )
|| aIncludeInvisibleText
|| noDrawItems )
if( ( Value().IsVisible() && valueLayerIsVisible ) || noDrawItems )
{
bbox.Merge( Value().GetBoundingBox() );
}
if( ( Reference().IsVisible() && refLayerIsVisible )
|| aIncludeInvisibleText
|| noDrawItems )
if( ( Reference().IsVisible() && refLayerIsVisible ) || noDrawItems )
{
bbox.Merge( Reference().GetBoundingBox() );
}
@ -1389,16 +1373,11 @@ const BOX2I FOOTPRINT::GetBoundingBox( bool aIncludeText, bool aIncludeInvisible
if( board )
{
if( ( aIncludeText && aIncludeInvisibleText ) || noDrawItems )
if( aIncludeText || noDrawItems )
{
m_boundingBoxCacheTimeStamp = board->GetTimeStamp();
m_cachedBoundingBox = bbox;
}
else if( aIncludeText )
{
m_visibleBBoxCacheTimeStamp = board->GetTimeStamp();
m_cachedVisibleBBox = bbox;
}
else
{
m_textExcludedBBoxCacheTimeStamp = board->GetTimeStamp();
@ -1749,7 +1728,7 @@ bool FOOTPRINT::HitTestOnLayer( const BOX2I& aRect, bool aContained, PCB_LAYER_I
bool FOOTPRINT::HitTest( const VECTOR2I& aPosition, int aAccuracy ) const
{
BOX2I rect = GetBoundingBox( false, false );
BOX2I rect = GetBoundingBox( false );
return rect.Inflate( aAccuracy ).Contains( aPosition );
}
@ -1767,17 +1746,17 @@ bool FOOTPRINT::HitTest( const BOX2I& aRect, bool aContained, int aAccuracy ) co
if( aContained )
{
return arect.Contains( GetBoundingBox( false, false ) );
return arect.Contains( GetBoundingBox( false ) );
}
else
{
// If the rect does not intersect the bounding box, skip any tests
if( !aRect.Intersects( GetBoundingBox( false, false ) ) )
if( !aRect.Intersects( GetBoundingBox( false ) ) )
return false;
// If there are no pads, zones, or drawings, allow intersection with text
if( m_pads.empty() && m_zones.empty() && m_drawings.empty() )
return GetBoundingBox( true, false ).Intersects( arect );
return GetBoundingBox( true ).Intersects( arect );
// Determine if any elements in the FOOTPRINT intersect the rect
for( PAD* pad : m_pads )
@ -2198,7 +2177,7 @@ double FOOTPRINT::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
const BOX2I FOOTPRINT::ViewBBox() const
{
BOX2I area = GetBoundingBox( true, true );
BOX2I area = GetBoundingBox( true );
// Inflate in case clearance lines are drawn around pads, etc.
if( const BOARD* board = GetBoard() )
@ -2271,7 +2250,6 @@ void FOOTPRINT::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
}
m_boundingBoxCacheTimeStamp = 0;
m_visibleBBoxCacheTimeStamp = 0;
m_textExcludedBBoxCacheTimeStamp = 0;
m_hullCacheTimeStamp = 0;
}
@ -2336,7 +2314,6 @@ void FOOTPRINT::Flip( const VECTOR2I& aCentre, bool aFlipLeftRight )
Rotate( aCentre, ANGLE_180 );
m_boundingBoxCacheTimeStamp = 0;
m_visibleBBoxCacheTimeStamp = 0;
m_textExcludedBBoxCacheTimeStamp = 0;
m_cachedHull.Mirror( aFlipLeftRight, !aFlipLeftRight, m_pos );
@ -2364,7 +2341,6 @@ void FOOTPRINT::SetPosition( const VECTOR2I& aPos )
item->Move( delta );
m_cachedBoundingBox.Move( delta );
m_cachedVisibleBBox.Move( delta );
m_cachedTextExcludedBBox.Move( delta );
m_courtyard_cache_back.Move( delta );
m_courtyard_cache_front.Move( delta );
@ -2411,7 +2387,6 @@ void FOOTPRINT::MoveAnchorPosition( const VECTOR2I& aMoveVector )
}
m_cachedBoundingBox.Move( moveVector );
m_cachedVisibleBBox.Move( moveVector );
m_cachedTextExcludedBBox.Move( moveVector );
m_cachedHull.Move( moveVector );
}
@ -2437,7 +2412,6 @@ void FOOTPRINT::SetOrientation( const EDA_ANGLE& aNewAngle )
item->Rotate( GetPosition(), angleChange );
m_boundingBoxCacheTimeStamp = 0;
m_visibleBBoxCacheTimeStamp = 0;
m_textExcludedBBoxCacheTimeStamp = 0;
m_cachedHull.Rotate( angleChange, GetPosition() );
@ -2609,7 +2583,7 @@ wxString FOOTPRINT::GetNextPadNumber( const wxString& aLastPadNumber ) const
void FOOTPRINT::AutoPositionFields()
{
// Auto-position reference and value
BOX2I bbox = GetBoundingBox( false, false );
BOX2I bbox = GetBoundingBox( false );
bbox.Inflate( pcbIUScale.mmToIU( 0.2 ) ); // Gap between graphics and text
if( Reference().GetPosition() == VECTOR2I( 0, 0 ) )

Some files were not shown because too many files have changed in this diff Show More