We don't always have a line when dragging.

Fixes https://gitlab.com/kicad/code/kicad/issues/12612
This commit is contained in:
Jeff Young 2022-10-10 11:26:51 +01:00
parent ea6fb84351
commit b2f05c758b
2 changed files with 10 additions and 4 deletions

View File

@ -266,6 +266,15 @@ void DRAGGER::SetMode( int aMode )
}
const std::vector<int> DRAGGER::CurrentNets() const
{
if( m_mode == PNS::DM_VIA )
return std::vector<int>( 1, m_draggedVia.net );
else
return std::vector<int>( 1, m_draggedLine.Net() );
}
bool DRAGGER::dragMarkObstacles( const VECTOR2I& aP )
{
// fixme: rewrite using shared_ptr...

View File

@ -88,10 +88,7 @@ public:
*
* Returns the net code(s) of currently routed track(s).
*/
const std::vector<int> CurrentNets() const override
{
return std::vector<int>( 1, m_draggedLine.Net() );
}
const std::vector<int> CurrentNets() const override;
/**
* Function CurrentLayer()