From f374df408ead67029f556ba29108bae42bb44031 Mon Sep 17 00:00:00 2001 From: XiaoFeng Date: Tue, 27 Oct 2015 14:41:31 +0800 Subject: [PATCH] Fix FadeOutDownTilesTest won't show last tile --- cocos/2d/CCActionTiledGrid.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cocos/2d/CCActionTiledGrid.cpp b/cocos/2d/CCActionTiledGrid.cpp index 0c2dd5097b..a96bfa7e91 100644 --- a/cocos/2d/CCActionTiledGrid.cpp +++ b/cocos/2d/CCActionTiledGrid.cpp @@ -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