Symbol Editor: do not allow to select fully invisible pins and fields
Of course, invisible pins or fields shown by using option Show invisible pins or Show invisible fields can be selected. From master branch
This commit is contained in:
parent
3d04d78f76
commit
b718c228fe
|
@ -1846,3 +1846,17 @@ void SYMBOL_EDIT_FRAME::UpdateItem( EDA_ITEM* aItem, bool isAddOrDelete, bool aU
|
|||
eda_text->ClearRenderCache();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool SYMBOL_EDIT_FRAME::GetShowInvisibleFields()
|
||||
{
|
||||
// Returns the current render option for invisible fields
|
||||
return GetRenderSettings()->m_ShowHiddenLibFields;
|
||||
}
|
||||
|
||||
|
||||
bool SYMBOL_EDIT_FRAME::GetShowInvisiblePins()
|
||||
{
|
||||
// Returns the current render option for invisible pins
|
||||
return GetRenderSettings()->m_ShowHiddenLibPins;
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Copyright (C) 2014 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2008 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2004-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2004-2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2017 CERN
|
||||
* @author Maciej Suminski <maciej.suminski@cern.ch>
|
||||
*
|
||||
|
@ -242,6 +242,9 @@ public:
|
|||
bool GetShowDeMorgan() const { return m_showDeMorgan; }
|
||||
void SetShowDeMorgan( bool show ) { m_showDeMorgan = show; }
|
||||
|
||||
bool GetShowInvisibleFields();
|
||||
bool GetShowInvisiblePins();
|
||||
|
||||
void ClearMsgPanel() override
|
||||
{
|
||||
UpdateSymbolMsgPanelInfo();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2019 CERN
|
||||
* Copyright (C) 2019-2023 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2019-2024 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -1055,8 +1055,35 @@ bool EE_SELECTION_TOOL::CollectHits( EE_COLLECTOR& aCollector, const VECTOR2I& a
|
|||
void EE_SELECTION_TOOL::narrowSelection( EE_COLLECTOR& collector, const VECTOR2I& aWhere,
|
||||
bool aCheckLocked, bool aSelectedOnly )
|
||||
{
|
||||
SYMBOL_EDIT_FRAME* symbolEditorFrame = dynamic_cast<SYMBOL_EDIT_FRAME*>( m_frame );
|
||||
|
||||
for( int i = collector.GetCount() - 1; i >= 0; --i )
|
||||
{
|
||||
if( symbolEditorFrame )
|
||||
{
|
||||
// Do not select invisible items if they are not displayed
|
||||
EDA_ITEM* item = static_cast<EDA_ITEM*>( collector[i] );
|
||||
|
||||
if( item->Type() == LIB_FIELD_T )
|
||||
{
|
||||
if( !static_cast<LIB_FIELD*>( item )->IsVisible()
|
||||
&& !symbolEditorFrame->GetShowInvisibleFields() )
|
||||
{
|
||||
collector.Remove( i );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if( item->Type() == LIB_PIN_T )
|
||||
{
|
||||
if( !static_cast<LIB_PIN*>( item )->IsVisible()
|
||||
&& !symbolEditorFrame->GetShowInvisiblePins() )
|
||||
{
|
||||
collector.Remove( i );
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !Selectable( collector[i], &aWhere ) )
|
||||
{
|
||||
collector.Remove( i );
|
||||
|
|
Loading…
Reference in New Issue