first fix

history works again, can load deleted layer
This commit is contained in:
Mienek
2020-01-28 11:52:15 +01:00
parent 61fdc099ec
commit db07e6fcb0
3 changed files with 10 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
history tool doesnt load polygon data on undo iff project was loaded 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) Gradient breaks Heap Size, when big Witdh and Height (appeared on 1280x720)
Heap block at 0000000025422990 modified at 0000000025422A28 past requested size of 88 Heap block at 0000000025422990 modified at 0000000025422A28 past requested size of 88

View File

@@ -158,6 +158,7 @@ void IntelliPhotoGui::slotDeleteLayer(){
// Create New Layer // Create New Layer
if(ok1) { if(ok1) {
paintingArea->deleteLayer(layerNumber - 1); paintingArea->deleteLayer(layerNumber - 1);
paintingArea->historyadd();
UpdateGui(); UpdateGui();
} }
} }

View File

@@ -524,6 +524,10 @@ void PaintingArea::historyGoBack(){
if (historyPresent != historyMaxPast) { if (historyPresent != historyMaxPast) {
if (--historyPresent == -1) if (--historyPresent == -1)
historyPresent = 99; historyPresent = 99;
if (layerBundle.size() > history[static_cast<size_t>(historyPresent)].size())
activeLayer--;
if ((layerBundle.size() == 0) && (layerBundle.size() < history[static_cast<size_t>(historyPresent)].size()))
activeLayer++;
layerBundle = history[static_cast<size_t>(historyPresent)]; layerBundle = history[static_cast<size_t>(historyPresent)];
} }
this->guiReference->UpdateGui(); this->guiReference->UpdateGui();
@@ -533,6 +537,10 @@ void PaintingArea::historyGoForward(){
if (historyPresent != historyMaxFuture) { if (historyPresent != historyMaxFuture) {
if (++historyPresent == 100) if (++historyPresent == 100)
historyPresent = 0; historyPresent = 0;
if (layerBundle.size() > history[static_cast<size_t>(historyPresent)].size())
activeLayer--;
if ((layerBundle.size() == 0) && (layerBundle.size() < history[static_cast<size_t>(historyPresent)].size()))
activeLayer++;
layerBundle = history[static_cast<size_t>(historyPresent)]; layerBundle = history[static_cast<size_t>(historyPresent)];
} }
this->guiReference->UpdateGui(); this->guiReference->UpdateGui();