Undo/redo preserve selected step

Fixes leozide/leocad#788
This commit is contained in:
Gerd Wachsmuth 2024-01-02 11:34:17 +01:00
parent cba4dfb468
commit b520fe0b6d

View file

@ -1748,12 +1748,19 @@ void lcModel::LoadCheckPoint(lcModelHistoryEntry* CheckPoint)
LoadedInfos.push_back(Info);
}
// Remember the current step
const lcStep CurrentStep = mCurrentStep;
DeleteModel();
QBuffer Buffer(&CheckPoint->File);
Buffer.open(QIODevice::ReadOnly);
LoadLDraw(Buffer, lcGetActiveProject());
// Reset the current step
mCurrentStep = CurrentStep;
CalculateStep(CurrentStep);
gMainWindow->UpdateTimeline(true, false);
gMainWindow->UpdateCameraMenu();
gMainWindow->UpdateCurrentStep();