Skip to content
Snippets Groups Projects
Commit 1a8db544 authored by jsiegle's avatar jsiegle
Browse files

Fix problem with editor insertion after a module was deleted

parent 6241a12f
No related branches found
No related tags found
No related merge requests found
...@@ -317,6 +317,12 @@ void EditorViewport::deleteNode(GenericEditor* editor) ...@@ -317,6 +317,12 @@ void EditorViewport::deleteNode(GenericEditor* editor)
refreshEditors(); refreshEditors();
getProcessorGraph()->removeProcessor((GenericProcessor*) editor->getProcessor()); getProcessorGraph()->removeProcessor((GenericProcessor*) editor->getProcessor());
insertionPoint = -1; // make sure all editors are left-justified
indexOfMovingComponent = -1;
somethingIsBeingDraggedOver = false;
} }
} }
...@@ -327,6 +333,8 @@ void EditorViewport::refreshEditors() ...@@ -327,6 +333,8 @@ void EditorViewport::refreshEditors()
int lastBound = borderSize+tabSize; int lastBound = borderSize+tabSize;
int totalWidth = 0; int totalWidth = 0;
std::cout << insertionPoint << std::endl;
bool tooLong; bool tooLong;
for (int n = 0; n < signalChainArray.size(); n++) for (int n = 0; n < signalChainArray.size(); n++)
...@@ -344,7 +352,7 @@ void EditorViewport::refreshEditors() ...@@ -344,7 +352,7 @@ void EditorViewport::refreshEditors()
int componentWidth = editorArray[n]->desiredWidth; int componentWidth = editorArray[n]->desiredWidth;
if (lastBound + componentWidth < getWidth()-tabSize && n >= leftmostEditor) if (lastBound + componentWidth < getWidth() - tabSize && n >= leftmostEditor)
{ {
if (n == 0) if (n == 0)
...@@ -387,7 +395,7 @@ void EditorViewport::refreshEditors() ...@@ -387,7 +395,7 @@ void EditorViewport::refreshEditors()
editorArray[n]->setVisible(true); editorArray[n]->setVisible(true);
// std::cout << "setting visible." << std::endl; // std::cout << "setting visible." << std::endl;
editorArray[n]->setBounds(lastBound, borderSize, componentWidth, getHeight()-borderSize*2); editorArray[n]->setBounds(lastBound, borderSize, componentWidth, getHeight()-borderSize*2);
lastBound+=(componentWidth + borderSize); lastBound += (componentWidth + borderSize);
tooLong = false; tooLong = false;
...@@ -786,6 +794,8 @@ void EditorViewport::mouseDrag(const MouseEvent& e) ...@@ -786,6 +794,8 @@ void EditorViewport::mouseDrag(const MouseEvent& e)
insertionPoint = editorArray.size(); insertionPoint = editorArray.size();
} }
refreshEditors(); refreshEditors();
repaint(); repaint();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment