From 1566509dc6c3a7b6b579c0088f627786b73ee6a6 Mon Sep 17 00:00:00 2001 From: BossCode45 Date: Thu, 25 Aug 2022 21:02:20 +1200 Subject: Frame disolving for wToWS --- main.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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& 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; } } -- cgit v1.2.3