Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Modified setContentOffset so that offset value could be reflected.

  • Loading branch information...
commit e018ebb9943672f455c00a7cc7dbcc246c2c6686 1 parent b689b21
@hekyou hekyou authored
Showing with 5 additions and 2 deletions.
  1. +5 −2 CCKit/CCScrollLayer.m
View
7 CCKit/CCScrollLayer.m
@@ -310,11 +310,14 @@ - (void)setContentOffset:(CGPoint)offset animated:(BOOL)animated
max = [self maxContainerOffset];
oldPoint = container.position;
- newX = MIN(oldPoint.x, max.x);
+ newX = MIN(offset.x, max.x);
newX = MAX(newX, min.x);
- newY = MIN(oldPoint.y, max.y);
+ newY = MIN(offset.y, max.y);
newY = MAX(newY, min.y);
+ if (newY == oldPoint.y && newX == oldPoint.x)
+ return;
+
if (animated) //animate scrolling
{
[container runAction:
Please sign in to comment.
Something went wrong with that request. Please try again.