diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2017-03-09 15:09:43 -0300 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2017-03-09 15:09:43 -0300 |
commit | 21ebf63bb59357000f9bb44acde176d4ff169c01 (patch) | |
tree | 2e3603bb0640b089d81844c5d37a8f6b5ce8da33 /Project/ControlEditor.cpp | |
parent | a1890bd024e0baea393480810709f43208825b9a (diff) | |
download | PSP.git-21ebf63bb59357000f9bb44acde176d4ff169c01.tar.gz PSP.git-21ebf63bb59357000f9bb44acde176d4ff169c01.tar.xz PSP.git-21ebf63bb59357000f9bb44acde176d4ff169c01.zip |
Sum implemented
Diffstat (limited to 'Project/ControlEditor.cpp')
-rw-r--r-- | Project/ControlEditor.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Project/ControlEditor.cpp b/Project/ControlEditor.cpp index 3638a42..3b6f8a5 100644 --- a/Project/ControlEditor.cpp +++ b/Project/ControlEditor.cpp @@ -103,7 +103,7 @@ ControlEditor::ControlEditor(wxWindow* parent) m_glContext = new wxGLContext(m_glCanvas); m_camera = new Camera(); m_selectionRect = wxRect2DDouble(0, 0, 0, 0); - //m_camera->SetScale(1.2); + // m_camera->SetScale(1.2); } ControlEditor::~ControlEditor() { @@ -282,6 +282,7 @@ void ControlEditor::OnDoubleClick(wxMouseEvent& event) Element* element = *it; if(element->Contains(m_camera->ScreenToWorld(clickPoint))) { element->ShowForm(this, element); + CheckConnections(); auto childList = element->GetChildList(); for(auto itC = childList.begin(), itEndC = childList.end(); itC != itEndC; ++itC) { ConnectionLine* line = static_cast<ConnectionLine*>(*itC); @@ -668,3 +669,15 @@ std::vector<ConnectionLine*>::iterator ControlEditor::DeleteLineFromList(std::ve if(cLine) delete cLine; return it; } + +void ControlEditor::CheckConnections() +{ + for(auto it = m_connectionList.begin(); it != m_connectionList.end(); ++it) { + ConnectionLine* cLine = *it; + if(cLine->GetType() == ConnectionLine::ELEMENT_ELEMENT) { + if(cLine->GetParentList().size() < 2){ + it = DeleteLineFromList(it); + } + } + } +} |