ddnguyen / slimmath

Automatically exported from code.google.com/p/slimmath
0 stars 0 forks source link

Color3.ToString() uses invalid format string #12

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create a project using slimmath
2. create a Color3 instance: Color3 exampleColor;
3. call exampleColor.ToString()

What is the expected output? What do you see instead?

expected: "Red:0.0 Green:0.0 Blue:0.0"
got: FormatException 
Exception.Message (german original): Der Index, basierend auf 0 (null), muss 
größer als oder gleich Null sein, und kleiner als die Größe der 
Argumentenliste.

rough translation: The zero based index must be greater than or equal zero, and 
less than the number of items in the argument list.

What version of the product are you using? On what operating system?
FileVersion: 1.0.0.0

Please provide any additional information below.

Original issue reported on code.google.com by goe...@gmx.de on 12 Jan 2011 at 6:17

GoogleCodeExporter commented 8 years ago
simple fix from looking at the source:
old:
return string.Format(CultureInfo.CurrentCulture, "Red:{1} Green:{2} Blue:{3}", 
Red, Green, Blue);

new: 
return string.Format(CultureInfo.CurrentCulture, "Red:{0} Green:{1} Blue:{2}", 
Red, Green, Blue);

I'd fix it myself but so far I wasn't able to find a way to apply as a commiter.

Original comment by goe...@gmx.de on 12 Jan 2011 at 7:16

GoogleCodeExporter commented 8 years ago
Thanks for catching that. Not sure why our tests missed such an error. I will 
commit your fix later today.

Original comment by Jorgy...@gmail.com on 14 Feb 2011 at 5:40

GoogleCodeExporter commented 8 years ago

Original comment by Jorgy...@gmail.com on 14 Feb 2011 at 8:05

GoogleCodeExporter commented 8 years ago
I know a great reason our tests didn't catch this... there was no test for 
Color3. At least not in the managed tests. I did fix it in r41 though.

Thank you!

Original comment by Jorgy...@gmail.com on 15 Feb 2011 at 1:15