summaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/main.cpp b/main.cpp
index 1724b82..a477e34 100644
--- a/main.cpp
+++ b/main.cpp
@@ -119,6 +119,25 @@ void wToWS(const KeyArg arg)
if(pSF[i] == fID)
{
pSF.erase(pSF.begin() + i);
+ int pID = frames.find(fID)->second.pID;
+ if(pSF.size() < 2 && !frames.find(pID)->second.isRoot)
+ {
+ //Erase parent frame
+ int lastChildID = frames.find(frames.find(pID)->second.subFrameIDs[0])->second.ID;
+ int parentParentID = frames.find(pID)->second.pID;
+ vector<int>& parentParentSubFrameIDs = frames.find(parentParentID)->second.subFrameIDs;
+ for(int j = 0; j < parentParentSubFrameIDs.size(); j++)
+ {
+ if(parentParentSubFrameIDs[j] == pID)
+ {
+ parentParentSubFrameIDs[j] = lastChildID;
+ frames.find(lastChildID)->second.pID = parentParentID;
+ frames.erase(pID);
+ break;
+ }
+ }
+ }
+
break;
}
}