mirror of https://github.com/axmolengine/axmol.git
Merge pull request #2578 from ricardoquesada/grid_projection_fix
Grid setProjection2D fix
This commit is contained in:
commit
3b77ffe478
|
@ -182,12 +182,12 @@ void CCGridBase::set2DProjection()
|
|||
|
||||
CCSize size = director->getWinSizeInPixels();
|
||||
|
||||
glViewport(0, 0, (GLsizei)(size.width * CC_CONTENT_SCALE_FACTOR()), (GLsizei)(size.height * CC_CONTENT_SCALE_FACTOR()) );
|
||||
glViewport(0, 0, (GLsizei)(size.width), (GLsizei)(size.height) );
|
||||
kmGLMatrixMode(KM_GL_PROJECTION);
|
||||
kmGLLoadIdentity();
|
||||
|
||||
kmMat4 orthoMatrix;
|
||||
kmMat4OrthographicProjection(&orthoMatrix, 0, size.width * CC_CONTENT_SCALE_FACTOR(), 0, size.height * CC_CONTENT_SCALE_FACTOR(), -1, 1);
|
||||
kmMat4OrthographicProjection(&orthoMatrix, 0, size.width, 0, size.height, -1, 1);
|
||||
kmGLMultMatrix( &orthoMatrix );
|
||||
|
||||
kmGLMatrixMode(KM_GL_MODELVIEW);
|
||||
|
|
Loading…
Reference in New Issue