Fix for setting Matrix/Vector values by Index

Many Matrix*/Vector* implementations were throwing
IndexOutOfBoundsException when you tried to set their values via their
indexer due to a missing else statement.
This commit is contained in:
Neil White 2013-09-24 15:34:39 +01:00
parent 7961997abe
commit fc1a8e022b
24 changed files with 24 additions and 24 deletions

View file

@ -182,7 +182,7 @@ namespace OpenTK
{ {
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -182,7 +182,7 @@ namespace OpenTK
{ {
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -184,7 +184,7 @@ namespace OpenTK
{ {
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -184,7 +184,7 @@ namespace OpenTK
{ {
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -205,7 +205,7 @@ namespace OpenTK
{ {
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -205,7 +205,7 @@ namespace OpenTK
{ {
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -245,7 +245,7 @@ namespace OpenTK
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -241,7 +241,7 @@ namespace OpenTK
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -186,7 +186,7 @@ namespace OpenTK
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -186,7 +186,7 @@ namespace OpenTK
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -239,7 +239,7 @@ namespace OpenTK
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -239,7 +239,7 @@ namespace OpenTK
if (rowIndex == 0) Row0[columnIndex] = value; if (rowIndex == 0) Row0[columnIndex] = value;
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -307,7 +307,7 @@ namespace OpenTK
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
else if (rowIndex == 3) Row3[columnIndex] = value; else if (rowIndex == 3) Row3[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -294,7 +294,7 @@ namespace OpenTK
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
else if (rowIndex == 3) Row3[columnIndex] = value; else if (rowIndex == 3) Row3[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -210,7 +210,7 @@ namespace OpenTK
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
else if (rowIndex == 3) Row3[columnIndex] = value; else if (rowIndex == 3) Row3[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -210,7 +210,7 @@ namespace OpenTK
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
else if (rowIndex == 3) Row3[columnIndex] = value; else if (rowIndex == 3) Row3[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -242,7 +242,7 @@ namespace OpenTK
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
else if (rowIndex == 3) Row3[columnIndex] = value; else if (rowIndex == 3) Row3[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -242,7 +242,7 @@ namespace OpenTK
else if (rowIndex == 1) Row1[columnIndex] = value; else if (rowIndex == 1) Row1[columnIndex] = value;
else if (rowIndex == 2) Row2[columnIndex] = value; else if (rowIndex == 2) Row2[columnIndex] = value;
else if (rowIndex == 3) Row3[columnIndex] = value; else if (rowIndex == 3) Row3[columnIndex] = value;
throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")"); else throw new IndexOutOfRangeException("You tried to set this matrix at: (" + rowIndex + ", " + columnIndex + ")");
} }
} }

View file

@ -121,7 +121,7 @@ namespace OpenTK
} set{ } set{
if(index == 0) X = value; if(index == 0) X = value;
else if(index == 1) Y = value; else if(index == 1) Y = value;
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index); else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
} }
} }

View file

@ -104,7 +104,7 @@ namespace OpenTK
} set{ } set{
if(index == 0) X = value; if(index == 0) X = value;
else if(index == 1) Y = value; else if(index == 1) Y = value;
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index); else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
} }
} }

View file

@ -133,7 +133,7 @@ namespace OpenTK
if(index == 0) X = value; if(index == 0) X = value;
else if(index == 1) Y = value; else if(index == 1) Y = value;
else if(index == 2) Z = value; else if(index == 2) Z = value;
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index); else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
} }
} }

View file

@ -131,7 +131,7 @@ namespace OpenTK
if(index == 0) X = value; if(index == 0) X = value;
else if(index == 1) Y = value; else if(index == 1) Y = value;
else if(index == 2) Z = value; else if(index == 2) Z = value;
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index); else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
} }
} }

View file

@ -193,7 +193,7 @@ namespace OpenTK
else if(index == 1) Y = value; else if(index == 1) Y = value;
else if(index == 2) Z = value; else if(index == 2) Z = value;
else if(index == 3) W = value; else if(index == 3) W = value;
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index); else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
} }
} }

View file

@ -191,7 +191,7 @@ namespace OpenTK
else if(index == 1) Y = value; else if(index == 1) Y = value;
else if(index == 2) Z = value; else if(index == 2) Z = value;
else if(index == 3) W = value; else if(index == 3) W = value;
throw new IndexOutOfRangeException("You tried to set this vector at index: " + index); else throw new IndexOutOfRangeException("You tried to set this vector at index: " + index);
} }
} }