diff --git a/knownBugs.txt b/knownBugs.txt index 824bf08..791709e 100644 --- a/knownBugs.txt +++ b/knownBugs.txt @@ -1,4 +1,4 @@ history tool doesnt load polygon data on undo iff project was loaded -history tool doesnt save delete Layer +history tool doesnt save delete Layer - done Gradient breaks Heap Size, when big Witdh and Height (appeared on 1280x720) Heap block at 0000000025422990 modified at 0000000025422A28 past requested size of 88 \ No newline at end of file diff --git a/src/GUI/IntelliPhotoGui.cpp b/src/GUI/IntelliPhotoGui.cpp index d3ab832..a5fed3d 100644 --- a/src/GUI/IntelliPhotoGui.cpp +++ b/src/GUI/IntelliPhotoGui.cpp @@ -158,6 +158,7 @@ void IntelliPhotoGui::slotDeleteLayer(){ // Create New Layer if(ok1) { paintingArea->deleteLayer(layerNumber - 1); + paintingArea->historyadd(); UpdateGui(); } } diff --git a/src/Layer/PaintingArea.cpp b/src/Layer/PaintingArea.cpp index 1b4236b..79e3cae 100644 --- a/src/Layer/PaintingArea.cpp +++ b/src/Layer/PaintingArea.cpp @@ -524,6 +524,10 @@ void PaintingArea::historyGoBack(){ if (historyPresent != historyMaxPast) { if (--historyPresent == -1) historyPresent = 99; + if (layerBundle.size() > history[static_cast(historyPresent)].size()) + activeLayer--; + if ((layerBundle.size() == 0) && (layerBundle.size() < history[static_cast(historyPresent)].size())) + activeLayer++; layerBundle = history[static_cast(historyPresent)]; } this->guiReference->UpdateGui(); @@ -533,6 +537,10 @@ void PaintingArea::historyGoForward(){ if (historyPresent != historyMaxFuture) { if (++historyPresent == 100) historyPresent = 0; + if (layerBundle.size() > history[static_cast(historyPresent)].size()) + activeLayer--; + if ((layerBundle.size() == 0) && (layerBundle.size() < history[static_cast(historyPresent)].size())) + activeLayer++; layerBundle = history[static_cast(historyPresent)]; } this->guiReference->UpdateGui();