mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 02:03:12 +02:00
router: make sure we are not committing VIAs with non-unique IDs, fixes random disappearing via issue
Note to self: LINE_PLACER::FixRoute used to silently reclaim the UID of the transient via (as used by the SHOVE's heads tracking logic). Depending on the particular sequence of user events (the bug is next to impossible to reproduce on a touchpad), this would result in freshly placed vias disappearing... Fixes https://gitlab.com/kicad/code/kicad/issues/20999
This commit is contained in:
parent
3813cbd40b
commit
c5a4f9e747
@ -1595,7 +1595,9 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
|
||||
///< false but someone with more knowledge of the code will need to determine that..
|
||||
if( m_lastNode )
|
||||
{
|
||||
m_lastNode->Add( Clone( pl.Via() ) );
|
||||
auto newVia = Clone( pl.Via() );
|
||||
newVia->ResetUid();
|
||||
m_lastNode->Add( std::move( newVia ) );
|
||||
m_shove->AddLockedSpringbackNode( m_lastNode );
|
||||
}
|
||||
|
||||
@ -1675,7 +1677,12 @@ bool LINE_PLACER::FixRoute( const VECTOR2I& aP, ITEM* aEndItem, bool aForceFinis
|
||||
}
|
||||
|
||||
if( pl.EndsWithVia() )
|
||||
m_lastNode->Add( Clone( pl.Via() ) );
|
||||
{
|
||||
auto newVia = Clone( pl.Via() );
|
||||
newVia->ResetUid();
|
||||
m_lastNode->Add( std::move( newVia ) );
|
||||
}
|
||||
|
||||
|
||||
if( realEnd && lastItem )
|
||||
simplifyNewLine( m_lastNode, lastItem );
|
||||
|
@ -43,6 +43,11 @@ public:
|
||||
m_uid( aOther.m_uid )
|
||||
{}
|
||||
|
||||
void ResetUid()
|
||||
{
|
||||
m_uid = genNextUid();
|
||||
}
|
||||
|
||||
UNIQ_ID Uid() const { return m_uid; }
|
||||
|
||||
virtual void SetWidth( int aWidth )
|
||||
|
Loading…
x
Reference in New Issue
Block a user