Additional fix to getMatrix

This commit is contained in:
Jonas Stamm 2025-11-10 15:27:25 +01:00
parent 2142433257
commit 2396b5867b

View File

@ -42,7 +42,7 @@ void setMatrixAt(MatrixType value, Matrix matrix, unsigned int rowIdx, unsigned
MatrixType getMatrixAt(const Matrix matrix, unsigned int rowIdx, unsigned int colIdx)
{
if(rowIdx < matrix.rows && colIdx < matrix.cols){
return matrix.buffer[rowIdx * matrix.cols + colIdx];
return matrix.buffer[rowIdx * matrix.cols + colIdx]; //ACHTUNG! rowIdx und colIDX sind in Array position gedacht! matrix.cols ist normal gedacht!
}else{
return 0;
}