Fix FadeOutDownTilesTest won't show last tile

This commit is contained in:
XiaoFeng 2015-10-27 14:41:31 +08:00
parent 036585ef95
commit f374df408e
1 changed files with 5 additions and 5 deletions

View File

@ -572,12 +572,12 @@ FadeOutDownTiles* FadeOutDownTiles::clone() const
float FadeOutDownTiles::testFunc(const Size& pos, float time)
{
Vec2 n = Vec2((float)_gridSize.width, (float)_gridSize.height) * (1.0f - time);
if (pos.height == 0)
{
return 1.0f;
}
//if (pos.height == 0)
//{
// return 1.0f;
//}
return powf(n.y / pos.height, 6);
return powf(n.y / (pos.height > 0.0f ? pos.height : 0.1f), 6);
}
// implementation of TurnOffTiles