Add create-wire logic to labels.
Fixes https://gitlab.com/kicad/code/kicad/issues/11768
This commit is contained in:
parent
f22cf1cc3a
commit
29900cad34
|
@ -1178,13 +1178,15 @@ void SCH_MOVE_TOOL::getConnectedDragItems( SCH_ITEM* aOriginalItem, const VECTOR
|
||||||
{
|
{
|
||||||
// Add a new wire between the symbol or junction and the selected item so
|
// Add a new wire between the symbol or junction and the selected item so
|
||||||
// the selected item can be dragged.
|
// the selected item can be dragged.
|
||||||
if( test->GetLayer() == LAYER_BUS_JUNCTION ||
|
if( test->GetLayer() == LAYER_BUS_JUNCTION
|
||||||
aOriginalItem->GetLayer() == LAYER_BUS )
|
|| aOriginalItem->GetLayer() == LAYER_BUS )
|
||||||
{
|
{
|
||||||
newWire = new SCH_LINE( aPoint, LAYER_BUS );
|
newWire = new SCH_LINE( aPoint, LAYER_BUS );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
newWire = new SCH_LINE( aPoint, LAYER_WIRE );
|
newWire = new SCH_LINE( aPoint, LAYER_WIRE );
|
||||||
|
}
|
||||||
|
|
||||||
newWire->SetFlags( IS_NEW );
|
newWire->SetFlags( IS_NEW );
|
||||||
m_frame->AddToScreen( newWire, m_frame->GetScreen() );
|
m_frame->AddToScreen( newWire, m_frame->GetScreen() );
|
||||||
|
@ -1246,6 +1248,26 @@ void SCH_MOVE_TOOL::getConnectedDragItems( SCH_ITEM* aOriginalItem, const VECTOR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if( test->IsConnected( aPoint ) && !newWire )
|
||||||
|
{
|
||||||
|
// Add a new wire between the label and the selected item so the selected item
|
||||||
|
// can be dragged.
|
||||||
|
if( test->GetLayer() == LAYER_BUS_JUNCTION
|
||||||
|
|| aOriginalItem->GetLayer() == LAYER_BUS )
|
||||||
|
{
|
||||||
|
newWire = new SCH_LINE( aPoint, LAYER_BUS );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newWire = new SCH_LINE( aPoint, LAYER_WIRE );
|
||||||
|
}
|
||||||
|
|
||||||
|
newWire->SetFlags( IS_NEW );
|
||||||
|
m_frame->AddToScreen( newWire, m_frame->GetScreen() );
|
||||||
|
|
||||||
|
newWire->SetFlags( SELECTED_BY_DRAG | STARTPOINT );
|
||||||
|
aList.push_back( newWire );
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue