Added 0-1 clamping to setgray

This commit is contained in:
Paolo Cignoni 2016-04-02 05:42:05 +00:00
parent f4686b3e0f
commit c5095c6e1b
1 changed files with 4 additions and 1 deletions

View File

@ -215,7 +215,10 @@ inline static Color4 GrayShade(float f)
inline void SetGrayShade(float f)
{
Import(Color4<float>(f,f,f,1));
if(f<0) f=0.0f;
else if(f>1) f=1.0f;
Import(Color4<float>(f,f,f,1));
}