Don't reserve space for private items when autoplacing.

This commit is contained in:
Jeff Young 2022-03-06 16:12:49 +00:00
parent 0dc857b5ab
commit c919817c18
3 changed files with 11 additions and 6 deletions

View File

@ -3,7 +3,7 @@
* *
* Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2004-2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com> * Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
* Copyright (C) 2004-2021 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 2004-2022 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -883,7 +883,8 @@ void LIB_SYMBOL::ViewGetLayers( int aLayers[], int& aCount ) const
} }
const EDA_RECT LIB_SYMBOL::GetBodyBoundingBox( int aUnit, int aConvert, bool aIncludePins ) const const EDA_RECT LIB_SYMBOL::GetBodyBoundingBox( int aUnit, int aConvert, bool aIncludePins,
bool aIncludePrivateItems ) const
{ {
EDA_RECT bbox; EDA_RECT bbox;
@ -895,6 +896,9 @@ const EDA_RECT LIB_SYMBOL::GetBodyBoundingBox( int aUnit, int aConvert, bool aIn
if( item.m_convert > 0 && aConvert > 0 && aConvert != item.m_convert ) if( item.m_convert > 0 && aConvert > 0 && aConvert != item.m_convert )
continue; continue;
if( item.IsPrivate() && !aIncludePrivateItems )
continue;
if( item.Type() == LIB_FIELD_T ) if( item.Type() == LIB_FIELD_T )
continue; continue;

View File

@ -219,7 +219,8 @@ public:
* if aConvert == 0 Convert is non used * if aConvert == 0 Convert is non used
* Fields are not taken in account * Fields are not taken in account
**/ **/
const EDA_RECT GetBodyBoundingBox( int aUnit, int aConvert, bool aIncludePins ) const; const EDA_RECT GetBodyBoundingBox( int aUnit, int aConvert, bool aIncludePins,
bool aIncludePrivateItems ) const;
const EDA_RECT GetBoundingBox() const override const EDA_RECT GetBoundingBox() const override
{ {

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -1315,9 +1315,9 @@ EDA_RECT SCH_SYMBOL::doGetBoundingBox( bool aIncludePins, bool aIncludeFields )
EDA_RECT bBox; EDA_RECT bBox;
if( m_part ) if( m_part )
bBox = m_part->GetBodyBoundingBox( m_unit, m_convert, aIncludePins ); bBox = m_part->GetBodyBoundingBox( m_unit, m_convert, aIncludePins, false );
else else
bBox = dummy()->GetBodyBoundingBox( m_unit, m_convert, aIncludePins ); bBox = dummy()->GetBodyBoundingBox( m_unit, m_convert, aIncludePins, false );
int x0 = bBox.GetX(); int x0 = bBox.GetX();
int xm = bBox.GetRight(); int xm = bBox.GetRight();