@@ -330,15 +330,15 @@ - (int) numHorizontalPages
330
330
if (!_pagingEnabled) return 0 ;
331
331
if (!self.contentSizeInPoints .width || !_contentNode.contentSizeInPoints .width ) return 0 ;
332
332
333
- return _contentNode.contentSizeInPoints .width / self.contentSizeInPoints .width ;
333
+ return roundf ( _contentNode.contentSizeInPoints .width / self.contentSizeInPoints .width ) ;
334
334
}
335
335
336
336
- (int ) numVerticalPages
337
337
{
338
338
if (!_pagingEnabled) return 0 ;
339
339
if (!self.contentSizeInPoints .height || !_contentNode.contentSizeInPoints .height ) return 0 ;
340
340
341
- return _contentNode.contentSizeInPoints .height / self.contentSizeInPoints .height ;
341
+ return roundf ( _contentNode.contentSizeInPoints .height / self.contentSizeInPoints .height ) ;
342
342
}
343
343
344
344
#pragma mark Panning and setting position
@@ -413,7 +413,7 @@ - (void) setScrollPosition:(CGPoint)newPos animated:(BOOL)animated
413
413
- (void )updateAndroidScrollTranslation : (CGPoint)worldPosition
414
414
{
415
415
#if __CC_PLATFORM_ANDROID
416
- _rawScrollTranslation = [self convertToWindowSpace: worldPosition];
416
+ _rawScrollTranslation = [self convertToWindowSpace: CGPointMake (- worldPosition.x, worldPosition.y) ];
417
417
#endif
418
418
}
419
419
@@ -501,7 +501,7 @@ - (void) update:(CCTime)df
501
501
502
502
_contentNode.position = ccpAdd (_contentNode.position , delta);
503
503
504
- [self updateAndroidScrollTranslation: CGPointMake (_contentNode.position.x, _contentNode.position.y * -1 )];
504
+ [self updateAndroidScrollTranslation: CGPointMake (_contentNode.position.x * - 1 , _contentNode.position.y * -1 )];
505
505
506
506
// Deaccelerate layer
507
507
float deaccelerationX = kCCScrollViewDeacceleration ;
@@ -863,7 +863,7 @@ - (BOOL)onScroll:(AndroidMotionEvent *)start end:(AndroidMotionEvent *)end dista
863
863
dx /= scaleFactor;
864
864
dy /= scaleFactor;
865
865
866
- _rawScrollTranslation.x + = dx;
866
+ _rawScrollTranslation.x - = dx;
867
867
_rawScrollTranslation.y -= dy;
868
868
869
869
CCDirector* dir = [CCDirector sharedDirector ];
0 commit comments