diff options
author | Thales1330 <thaleslima.ufu@gmail.com> | 2017-01-28 14:50:12 -0200 |
---|---|---|
committer | Thales1330 <thaleslima.ufu@gmail.com> | 2017-01-28 14:50:12 -0200 |
commit | 5e7c19ae397164dd718b2593663cee5d1be687cd (patch) | |
tree | ea14141c3f4bb83ea8448cf017dfeb5b211611a0 /Project/ControlEditor.cpp | |
parent | 10bb7105946bc0a892a9daf42ec5181ad9994fcf (diff) | |
download | PSP.git-5e7c19ae397164dd718b2593663cee5d1be687cd.tar.gz PSP.git-5e7c19ae397164dd718b2593663cee5d1be687cd.tar.xz PSP.git-5e7c19ae397164dd718b2593663cee5d1be687cd.zip |
Node bug fixes, tf form implemented
Diffstat (limited to 'Project/ControlEditor.cpp')
-rw-r--r-- | Project/ControlEditor.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/Project/ControlEditor.cpp b/Project/ControlEditor.cpp index 80c0813..cf79283 100644 --- a/Project/ControlEditor.cpp +++ b/Project/ControlEditor.cpp @@ -262,7 +262,23 @@ void ControlEditor::OnPaint(wxPaintEvent& event) event.Skip(); } -void ControlEditor::OnDoubleClick(wxMouseEvent& event) {} +void ControlEditor::OnDoubleClick(wxMouseEvent& event) +{ + wxPoint2DDouble clickPoint = event.GetPosition(); + bool redraw = false; + + if(m_mode == MODE_EDIT) { + for(auto it = m_elementList.begin(), itEnd = m_elementList.end(); it != itEnd; ++it) { + Element* element = *it; + if(element->Contains(m_camera->ScreenToWorld(clickPoint))) { + element->ShowForm(this, element); + redraw = true; + } + } + } + + if(redraw) Redraw(); +} void ControlEditor::OnLeftClickDown(wxMouseEvent& event) { @@ -284,7 +300,7 @@ void ControlEditor::OnLeftClickDown(wxMouseEvent& event) foundElement = true; } } - + if(!foundNode) { // Set movement initial position (not necessarily will be moved). element->StartMove(m_camera->ScreenToWorld(clickPoint)); |