mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
sch groups/lines: correctly handle view lifetime and drawing in group
This commit is contained in:
parent
6a24c5c5a4
commit
82043e374a
@ -262,6 +262,12 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
{
|
||||
case CHT_ADD:
|
||||
{
|
||||
if( selTool && selTool->GetEnteredGroup() && !schItem->GetParentGroup()
|
||||
&& SCH_GROUP::IsGroupableType( schItem->Type() ) )
|
||||
{
|
||||
selTool->GetEnteredGroup()->AddItem( schItem );
|
||||
}
|
||||
|
||||
updateConnectivityFlag();
|
||||
|
||||
if( !( aCommitFlags & SKIP_UNDO ) )
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <eeschema_settings.h>
|
||||
#include <eda_item.h>
|
||||
#include <sch_connection.h>
|
||||
#include <sch_group.h>
|
||||
#include <sch_item.h>
|
||||
#include <sch_screen.h>
|
||||
#include <sch_sheet_path.h>
|
||||
@ -135,6 +136,9 @@ SCH_ITEM* SCH_ITEM::Duplicate( bool doClone ) const
|
||||
if( !doClone )
|
||||
const_cast<KIID&>( newItem->m_Uuid ) = KIID();
|
||||
|
||||
if( newItem->GetParentGroup() )
|
||||
newItem->GetParentGroup()->AddItem( newItem );
|
||||
|
||||
newItem->ClearFlags( SELECTED | BRIGHTENED );
|
||||
|
||||
newItem->RunOnChildren(
|
||||
|
@ -90,6 +90,12 @@ SCH_LINE::SCH_LINE( const SCH_LINE& aLine ) :
|
||||
m_lastResolvedColor = aLine.m_lastResolvedColor;
|
||||
|
||||
m_operatingPoint = aLine.m_operatingPoint;
|
||||
|
||||
// Don't apply groups to cloned lines. We have too many areas where we clone them
|
||||
// temporarily, then modify/split/join them in the line movement routines after the
|
||||
// segments are committed. Rely on the commit framework to add the lines to the
|
||||
// entered group as appropriate.
|
||||
m_group = nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3088,7 +3088,10 @@ void SCH_SELECTION_TOOL::ClearSelection( bool aQuietMode )
|
||||
|
||||
void SCH_SELECTION_TOOL::select( EDA_ITEM* aItem )
|
||||
{
|
||||
if( m_enteredGroup && !SCH_GROUP::WithinScope( static_cast<SCH_ITEM*>( aItem ), m_enteredGroup, m_isSymbolEditor ) )
|
||||
// Don't group when we select new items, the schematic editor selects all new items for moving.
|
||||
// The PCB editor doesn't need this logic because it doesn't select new items for moving.
|
||||
if( m_enteredGroup && !aItem->IsNew()
|
||||
&& !SCH_GROUP::WithinScope( static_cast<SCH_ITEM*>( aItem ), m_enteredGroup, m_isSymbolEditor ) )
|
||||
{
|
||||
ExitGroup();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user