diff --git a/src/gui/PivotGui.cpp b/src/gui/PivotGui.cpp index bcd056f..30ce92b 100644 --- a/src/gui/PivotGui.cpp +++ b/src/gui/PivotGui.cpp @@ -37,8 +37,12 @@ void PivotGui::Render() { ImGui::BeginChild("MatriceInitiale", ImVec2(topLeftWindowSize.x, io.DisplaySize.y * 0.7f), false); - // Resize matrixValues - matrixValues.resize(matrixSizeY, std::vector(matrixSizeX, 0)); + // Resize matrixValues and initialize new elements to 0 + + matrixValues.resize(matrixSizeY); + for(auto& row : matrixValues) { + row.resize(matrixSizeX, 0); + } for (int y = 0; y < matrixSizeY; y++) { for (int x = 0; x < matrixSizeX; x++) {