Skip to content

Commit 4710a0c

Browse files
committed
fixed some resets on patch load
1 parent 2aca83c commit 4710a0c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/ofxVisualProgramming.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,6 +1120,7 @@ void ofxVisualProgramming::newTempPatchFromFile(string patchFile){
11201120
void ofxVisualProgramming::preloadPatch(string patchFile){
11211121
currentPatchFile = patchFile;
11221122
tempPatchFile = currentPatchFile;
1123+
11231124
// clear previous patch
11241125
for(map<int,shared_ptr<PatchObject>>::iterator it = patchObjects.begin(); it != patchObjects.end(); it++ ){
11251126
if(it->second->getName() != "audio device"){
@@ -1131,6 +1132,9 @@ void ofxVisualProgramming::preloadPatch(string patchFile){
11311132
}
11321133

11331134
it->second->outPut.clear();
1135+
1136+
glm::vec3 temp = canvas.screenToWorld(glm::vec3(ofGetWindowWidth()/2,ofGetWindowHeight()/2 + 100,0));
1137+
it->second->move(temp.x,temp.y);
11341138
}
11351139
}
11361140
resetTime = ofGetElapsedTimeMillis();
@@ -1142,6 +1146,9 @@ void ofxVisualProgramming::openPatch(string patchFile){
11421146

11431147
bLoadingNewPatch = true;
11441148

1149+
// reset subpatch level
1150+
currentSubpatch = "root";
1151+
11451152
currentPatchFile = patchFile;
11461153
ofFile temp(currentPatchFile);
11471154
currentPatchFolderPath = temp.getEnclosingDirectory();

0 commit comments

Comments
 (0)