Skip to content

Commit

Permalink
CCScrollLayer: implemented fix from cjkeeme. Fixes cocos2d#23
Browse files Browse the repository at this point in the history
  • Loading branch information
psineur committed Jun 10, 2011
1 parent 410b873 commit 6f88fd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions AUTHORS.cocos2d-extensions
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ People/companies who were/are contributing code to cocos2d-iphone-extensions (al

* Israel Roth (http://srooltheknife.blogspot.com/)
CCSliderControl author

* Jeff Keeme (cjkeeme) (http://www.myblackdogbooks.com/)
Fix for issue #23 (CCScrollLayer page indicator artifacts)

* Simon Skinner (twitter: @vultuk) (http://www.dk101.net/)
CCScrollLayer original author
Expand Down
9 changes: 6 additions & 3 deletions Extensions/CCScrollLayer/CCScrollLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ - (void) visit

// Set GL Values
glEnable(GL_POINT_SMOOTH);
glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
glPointSize(6.0f * CC_CONTENT_SCALE_FACTOR());
GLboolean blendWasEnabled = glIsEnabled( GL_BLEND );
glEnable(GL_BLEND);
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glPointSize( 6.0 * CC_CONTENT_SCALE_FACTOR() );

// Draw Gray Points
glColor4ub(0x96,0x96,0x96,0xFF);
Expand All @@ -146,8 +148,9 @@ - (void) visit

// Restore GL Values
glPointSize(1.0f);
glHint(GL_POINT_SMOOTH_HINT,GL_FASTEST);
glDisable(GL_POINT_SMOOTH);
if (! blendWasEnabled)
glDisable(GL_BLEND);
}
}

Expand Down
3 changes: 0 additions & 3 deletions Tests/CCScrollLayerTest/CCScrollLayerTestLayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ -(id) init
// get screen size
CGSize screenSize = [CCDirector sharedDirector].winSize;

// Use 2D Projection to avoid issue #23
[[CCDirector sharedDirector] setProjection: kCCDirectorProjection2D];

/////////////////////////////////////////////////
// PAGE 1
////////////////////////////////////////////////
Expand Down

0 comments on commit 6f88fd4

Please sign in to comment.