From 61f3ba56ca79e848c86151b5222164eee53e58a5 Mon Sep 17 00:00:00 2001 From: "jamornh@gmail.com" Date: Mon, 4 Aug 2014 18:58:12 +0700 Subject: [PATCH] Fixed #916. CCScrollView scrollViewDidScroll: now fires once at the end of a scroll instead of once every update loop. --- cocos2d-ui/CCScrollView.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cocos2d-ui/CCScrollView.m b/cocos2d-ui/CCScrollView.m index 9c7c7407cf6..ec11a667627 100644 --- a/cocos2d-ui/CCScrollView.m +++ b/cocos2d-ui/CCScrollView.m @@ -114,7 +114,9 @@ -(void) update: (CCTime) t float y = node.position.y; node.position = ccp(x,y); - block(); + if (node.position.x == _endPosition) { + block(); + } } @end @@ -154,7 +156,9 @@ -(void) update: (CCTime) t float x = node.position.x; node.position = ccp(x,y); - block(); + if (node.position.y == _endPosition) { + block(); + } } @end