Skip to content

Commit

Permalink
Update Extensions/CCLayerPanZoom/CCLayerPanZoom.m
Browse files Browse the repository at this point in the history
  • Loading branch information
fishcake committed Apr 28, 2012
1 parent 06713fd commit 256639c
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions Extensions/CCLayerPanZoom/CCLayerPanZoom.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ - (id) init
self.rubberEffectRecoveryTime = 0.2f;
_rubberEffectRecovering = NO;
_rubberEffectZooming = NO;

_isTouchBeganCalled = NO;
}
return self;
}
Expand All @@ -222,8 +220,6 @@ - (id) init
- (void) ccTouchesBegan: (NSSet *) touches
withEvent: (UIEvent *) event
{
_isTouchBeganCalled = YES;

for (UITouch *touch in [touches allObjects])
{
// Add new touche to the array with current touches
Expand All @@ -247,7 +243,7 @@ - (void) ccTouchesMoved: (NSSet *) touches
// However, when the scene is transitioning in, ccTouchesBegan is not called,
// causing self.touches to be empty, thus crashing the app due to an attempt
// to access an empty array.
if (!_isTouchBeganCalled) return;
if ([self.touches count] == 0) return;

BOOL multitouch = [self.touches count] > 1;
if (multitouch)
Expand Down Expand Up @@ -328,8 +324,6 @@ - (void) ccTouchesMoved: (NSSet *) touches
- (void) ccTouchesEnded: (NSSet *) touches
withEvent: (UIEvent *) event
{
_isTouchBeganCalled = NO;

_singleTouchTimestamp = INFINITY;

// Process click event in single touch.
Expand Down Expand Up @@ -362,8 +356,6 @@ - (void) ccTouchesEnded: (NSSet *) touches
- (void) ccTouchesCancelled: (NSSet *) touches
withEvent: (UIEvent *) event
{
_isTouchBeganCalled = NO;

for (UITouch *touch in [touches allObjects])
{
// Remove touche from the array with current touches
Expand Down

0 comments on commit 256639c

Please sign in to comment.