Don't dirty connectivity when moving non-reference SCH_FIELD.

(cherry picked from commit 2e9ed67e05)
This commit is contained in:
Jeff Young 2023-02-07 12:05:41 +00:00
parent b24ee1c44f
commit a292bf7c83
3 changed files with 32 additions and 12 deletions

View File

@ -2317,20 +2317,19 @@ void SCH_PAINTER::draw( const SCH_SYMBOL* aSymbol, int aLayer )
if( aSymbol->GetDNP() )
{
COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
BOX2I bbox = aSymbol->GetBodyAndPinsBoundingBox();
VECTOR2I pt1 = bbox.GetOrigin();
VECTOR2I pt2 = bbox.GetEnd();
m_gal->SetIsStroke( true );
m_gal->SetIsFill( true );
COLOR_SETTINGS* colors = Pgm().GetSettingsManager().GetColorSettings();
m_gal->SetStrokeColor( colors->GetColor( LAYER_ERC_ERR ) );
m_gal->SetFillColor( colors->GetColor( LAYER_ERC_ERR ) );
m_gal->DrawSegment( bbox.GetOrigin(), bbox.GetEnd(),
3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) );
m_gal->DrawSegment( bbox.GetOrigin() + VECTOR2I( bbox.GetWidth(), 0 ),
bbox.GetOrigin() + VECTOR2I( 0, bbox.GetHeight() ),
3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) );
m_gal->DrawSegment( pt1, pt2, 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) );
std::swap( pt1.x, pt2.x );
m_gal->DrawSegment( pt1, pt2, 3.0 * schIUScale.MilsToIU( DEFAULT_LINE_WIDTH_MILS ) );
}
}
@ -2398,6 +2397,16 @@ void SCH_PAINTER::draw( const SCH_FIELD* aField, int aLayer, bool aDimmed )
bbox.Offset( label->GetSchematicTextOffset( &m_schSettings ) );
}
if( m_schSettings.GetDrawBoundingBoxes() )
{
m_gal->SetIsFill( false );
m_gal->SetIsStroke( true );
m_gal->SetStrokeColor( aField->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 )
: COLOR4D( 0.2, 0.2, 0.2, 1 ) );
m_gal->SetLineWidth( schIUScale.MilsToIU( 3 ) );
m_gal->DrawRectangle( bbox.GetOrigin(), bbox.GetEnd() );
}
m_gal->SetStrokeColor( color );
m_gal->SetFillColor( color );

View File

@ -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-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2023 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
@ -158,7 +158,14 @@ protected:
if( editFrame )
{
if( itemType == SCH_PIN_T || itemType == SCH_FIELD_T || itemType == SCH_SHEET_PIN_T )
if( itemType == SCH_FIELD_T )
{
editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
static_cast<SCH_ITEM*>( aItem->GetParent() ),
UNDO_REDO::CHANGED, aAppend,
false );
}
else if( itemType == SCH_PIN_T || itemType == SCH_SHEET_PIN_T )
{
editFrame->SaveCopyInUndoList( editFrame->GetScreen(),
static_cast<SCH_ITEM*>( aItem->GetParent() ),

View File

@ -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-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2019-2023 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
@ -1361,11 +1361,15 @@ int SCH_EDIT_TOOL::DeleteItemCursor( const TOOL_EVENT& aEvent )
void SCH_EDIT_TOOL::editFieldText( SCH_FIELD* aField )
{
KICAD_T parentType = aField->GetParent() ? aField->GetParent()->Type() : SCHEMATIC_T;
// Save old symbol in undo list if not already in edit, or moving.
if( aField->GetEditFlags() == 0 ) // i.e. not edited, or moved
saveCopyInUndoList( aField, UNDO_REDO::CHANGED );
KICAD_T parentType = aField->GetParent() ? aField->GetParent()->Type() : SCHEMATIC_T;
if( parentType == SCH_SYMBOL_T && aField->GetId() == REFERENCE_FIELD )
static_cast<SCH_ITEM*>( aField->GetParent() )->SetConnectivityDirty();
wxString caption;
// Use title caps for mandatory fields. "Edit Sheet name Field" looks dorky.