mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
Merge branch kicad:master into master
This commit is contained in:
commit
4ede7ac89b
@ -415,6 +415,16 @@ void SCH_COMMIT::pushSchEdit( const wxString& aMessage, int aCommitFlags )
|
||||
// after edition (selected items must keep their selection flag).
|
||||
const int selected_mask = ( SELECTED | STARTPOINT | ENDPOINT );
|
||||
schItem->ClearFlags( EDA_ITEM_ALL_FLAGS - selected_mask );
|
||||
|
||||
if( schItem->Type() == SCH_SHEET_T || schItem->Type() == SCH_SYMBOL_T )
|
||||
{
|
||||
schItem->RunOnChildren(
|
||||
[&]( SCH_ITEM* child )
|
||||
{
|
||||
child->ClearFlags( EDA_ITEM_ALL_FLAGS - selected_mask );
|
||||
},
|
||||
RECURSE_MODE::NO_RECURSE );
|
||||
}
|
||||
}
|
||||
|
||||
if( schematic )
|
||||
|
@ -1483,12 +1483,14 @@ void SCH_PAINTER::draw( const SCH_LINE* aLine, int aLayer )
|
||||
m_gal->SetStrokeColor( color );
|
||||
m_gal->SetLineWidth( width );
|
||||
|
||||
double lineWidth = getLineWidth( aLine, drawingShadows, drawingNetColorHighlights );
|
||||
double arcRadius = lineWidth * ADVANCED_CFG::GetCfg().m_hopOverArcRadius;
|
||||
std::vector<VECTOR3I> curr_wire_shape;
|
||||
|
||||
if( aLine->IsWire() && showHopOver )
|
||||
{
|
||||
double lineWidth = getLineWidth( aLine, false, drawingNetColorHighlights );
|
||||
double arcRadius = lineWidth * ADVANCED_CFG::GetCfg().m_hopOverArcRadius;
|
||||
curr_wire_shape = aLine->BuildWireWithHopShape( m_schematic->GetCurrentScreen(), arcRadius );
|
||||
}
|
||||
else
|
||||
{
|
||||
curr_wire_shape.emplace_back( aLine->GetStartPoint().x, aLine->GetStartPoint().y, 0 );
|
||||
|
@ -1166,8 +1166,7 @@ void SCH_MOVE_TOOL::getConnectedItems( SCH_ITEM* aOriginalItem, const VECTOR2I&
|
||||
if( pin->IsConnected( aPoint ) )
|
||||
{
|
||||
if( pin->IsSelected() )
|
||||
m_specialCaseSheetPins[pin] = { line,
|
||||
line->GetStartPoint() == aPoint };
|
||||
m_specialCaseSheetPins[pin] = { line, line->GetStartPoint() == aPoint };
|
||||
|
||||
aList.push_back( pin );
|
||||
}
|
||||
@ -1286,7 +1285,8 @@ void SCH_MOVE_TOOL::getConnectedDragItems( SCH_COMMIT* aCommit, SCH_ITEM* aSelec
|
||||
|
||||
for( SCH_SHEET_PIN* pin : sheet->GetPins() )
|
||||
{
|
||||
if( !pin->IsSelected() && pin->GetPosition() == aSelectedItem->GetPosition()
|
||||
if( !pin->IsSelected()
|
||||
&& pin->GetPosition() == aSelectedItem->GetPosition()
|
||||
&& pin->CanConnect( aSelectedItem ) )
|
||||
{
|
||||
itemsConnectable.push_back( pin );
|
||||
@ -1298,7 +1298,8 @@ void SCH_MOVE_TOOL::getConnectedDragItems( SCH_COMMIT* aCommit, SCH_ITEM* aSelec
|
||||
|
||||
// Skip ourselves, skip already selected items (but not lines, they need both ends tested)
|
||||
// and skip unconnectable items
|
||||
if( item == aSelectedItem || ( item->Type() != SCH_LINE_T && item->IsSelected() )
|
||||
if( item == aSelectedItem
|
||||
|| ( item->Type() != SCH_LINE_T && item->IsSelected() )
|
||||
|| !item->CanConnect( aSelectedItem ) )
|
||||
{
|
||||
continue;
|
||||
@ -1505,10 +1506,8 @@ void SCH_MOVE_TOOL::getConnectedDragItems( SCH_COMMIT* aCommit, SCH_ITEM* aSelec
|
||||
|
||||
if( line->HitTest( label->GetTextPos(), 1 ) )
|
||||
{
|
||||
if( ( !line->HasFlag( STARTPOINT )
|
||||
&& label->GetPosition() == line->GetStartPoint() )
|
||||
|| ( !line->HasFlag( ENDPOINT )
|
||||
&& label->GetPosition() == line->GetEndPoint() ) )
|
||||
if( ( !line->HasFlag( STARTPOINT ) && label->GetPosition() == line->GetStartPoint() )
|
||||
|| ( !line->HasFlag( ENDPOINT ) && label->GetPosition() == line->GetEndPoint() ) )
|
||||
{
|
||||
//If we have a line selected at only one end, don't grab labels
|
||||
//connected directly to the unselected endpoint
|
||||
@ -1551,7 +1550,7 @@ void SCH_MOVE_TOOL::getConnectedDragItems( SCH_COMMIT* aCommit, SCH_ITEM* aSelec
|
||||
{
|
||||
SCH_LINE* line = static_cast<SCH_LINE*>( aSelectedItem );
|
||||
|
||||
if( ( !line->HasFlag( STARTPOINT ) && test->IsConnected( line->GetStartPoint() ) )
|
||||
if( ( !line->HasFlag( STARTPOINT ) && test->IsConnected( line->GetStartPoint() ) )
|
||||
|| ( !line->HasFlag( ENDPOINT ) && test->IsConnected( line->GetEndPoint() ) ) )
|
||||
{
|
||||
// If we have a line selected at only one end, don't grab bus entries
|
||||
|
@ -47,11 +47,18 @@ static const wxString DocFormat = wxT(
|
||||
|
||||
std::optional<wxString> GetFootprintDocumentationURL( const FOOTPRINT& aFootprint )
|
||||
{
|
||||
// Footprints have now a field (FIELD_T::DATASHEET) containing the url datasheet
|
||||
// But old footprints did not have this field, so this fiels can be empty.
|
||||
// So we use this field is not empty, and if empty see if the documentation has an URL
|
||||
const PCB_FIELD* data_field = aFootprint.GetField( FIELD_T::DATASHEET );
|
||||
wxString url = data_field->GetText();
|
||||
|
||||
if( !url.IsEmpty() )
|
||||
return url;
|
||||
|
||||
wxString desc = aFootprint.GetLibDescription();
|
||||
|
||||
wxString url;
|
||||
|
||||
// It is currently common practice to store a documentation link in the description.
|
||||
// It is (or was) currently common practice to store a documentation link in the description.
|
||||
size_t idx = desc.find( wxT( "http:" ) );
|
||||
|
||||
if( idx == wxString::npos )
|
||||
@ -87,6 +94,7 @@ std::optional<wxString> GetFootprintDocumentationURL( const FOOTPRINT& aFootprin
|
||||
|
||||
if( url.IsEmpty() )
|
||||
return std::nullopt;
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user