Check for dirtied items in the cluster
When drawing the ratsnest, we need to be careful to avoid accessing
CONN_ITEMs that have been changed by the underlying model. Checking for
dirty items instead of valid items will prevent us looking at data that
are out of date
Fixes https://gitlab.com/kicad/code/kicad/issues/14265
(cherry picked from commit 283770fc45
)
This commit is contained in:
parent
7b4dd2f7f5
commit
9995b8714b
|
@ -290,7 +290,7 @@ void BOARD::UpdateRatsnestExclusions()
|
|||
[&]( CN_EDGE& aEdge )
|
||||
{
|
||||
if( aEdge.GetSourceNode() && aEdge.GetTargetNode()
|
||||
&& aEdge.GetSourceNode()->Valid() && aEdge.GetTargetNode()->Valid() )
|
||||
&& !aEdge.GetSourceNode()->Dirty() && !aEdge.GetTargetNode()->Dirty() )
|
||||
{
|
||||
std::pair<KIID, KIID> ids = { aEdge.GetSourceNode()->Parent()->m_Uuid,
|
||||
aEdge.GetTargetNode()->Parent()->m_Uuid };
|
||||
|
|
|
@ -275,6 +275,12 @@ bool CN_ANCHOR::Valid() const
|
|||
}
|
||||
|
||||
|
||||
bool CN_ANCHOR::Dirty() const
|
||||
{
|
||||
return !Valid() || m_item->Dirty();
|
||||
}
|
||||
|
||||
|
||||
bool CN_ANCHOR::IsDangling() const
|
||||
{
|
||||
int accuracy = 0;
|
||||
|
|
|
@ -72,6 +72,8 @@ public:
|
|||
|
||||
bool Valid() const;
|
||||
|
||||
bool Dirty() const;
|
||||
|
||||
CN_ITEM* Item() const
|
||||
{
|
||||
return m_item;
|
||||
|
|
Loading…
Reference in New Issue