From 7aed88dbcf9d37a1f40c8cad115f055c4d69e7a9 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 29 Dec 2016 19:03:16 -0200 Subject: Parent/child optimization implemented And others bugfixes. --- Project/Shunt.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Project/Shunt.cpp') diff --git a/Project/Shunt.cpp b/Project/Shunt.cpp index d932abd..0cd5736 100644 --- a/Project/Shunt.cpp +++ b/Project/Shunt.cpp @@ -34,8 +34,11 @@ void Shunt::MoveNode(Element* element, wxPoint2DDouble position) } else { if(m_activeNodeID == 1) { m_pointList[0] = m_movePts[0] + position - m_moveStartPt; - m_parentList[0] = NULL; - m_online = false; + if(m_parentList[0]) { + m_parentList[0]->RemoveChild(this); + m_parentList[0] = NULL; + m_online = false; + } } } @@ -109,6 +112,7 @@ void Shunt::UpdateNodes() 10 + 2.0 * m_borderSize, 10 + 2.0 * m_borderSize); if(!m_parentList[0]->Intersects(nodeRect)) { + m_parentList[0]->RemoveChild(this); m_parentList[0] = NULL; m_online = false; UpdateSwitchesPosition(); -- cgit From a1932eec23589ed67d824873b37de3e83a09cd24 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Tue, 3 Jan 2017 19:03:12 -0200 Subject: Text element optimizated, but buggy Element/parent search buggy --- Project/Shunt.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/Shunt.cpp') diff --git a/Project/Shunt.cpp b/Project/Shunt.cpp index 0cd5736..cbd424e 100644 --- a/Project/Shunt.cpp +++ b/Project/Shunt.cpp @@ -57,6 +57,7 @@ void Shunt::StartMove(wxPoint2DDouble position) void Shunt::RemoveParent(Element* parent) { if(parent == m_parentList[0]) { + m_parentList[0]->RemoveChild(this); m_parentList[0] = NULL; m_online = false; UpdateSwitchesPosition(); -- cgit From b6f96ca48bc156898df79deba63d270b393fb150 Mon Sep 17 00:00:00 2001 From: Thales1330 Date: Thu, 5 Jan 2017 19:31:28 -0200 Subject: Text bugs fixed --- Project/Shunt.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'Project/Shunt.cpp') diff --git a/Project/Shunt.cpp b/Project/Shunt.cpp index cbd424e..0cd5736 100644 --- a/Project/Shunt.cpp +++ b/Project/Shunt.cpp @@ -57,7 +57,6 @@ void Shunt::StartMove(wxPoint2DDouble position) void Shunt::RemoveParent(Element* parent) { if(parent == m_parentList[0]) { - m_parentList[0]->RemoveChild(this); m_parentList[0] = NULL; m_online = false; UpdateSwitchesPosition(); -- cgit