fixing auto-insert of garbage values when adding columns
All checks were successful
Linux arm64 / Build (push) Successful in 37m37s

This commit is contained in:
2024-05-10 15:35:41 +02:00
parent b239c0aaff
commit 5fac74cefc

View File

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