migrate ScrollView to director matrix stack

This commit is contained in:
Huabing.Xu 2014-04-03 15:55:37 +08:00
parent 960ac300d5
commit bb19e39e37
1 changed files with 6 additions and 4 deletions

View File

@ -567,10 +567,12 @@ void ScrollView::visit(Renderer *renderer, const kmMat4 &parentTransform, bool p
_transformUpdated = false;
// IMPORTANT:
// To ease the migration to v3.0, we still support the kmGL stack,
// To ease the migration to v3.0, we still support the kmMat4 stack,
// but it is deprecated and your code should not rely on it
kmGLPushMatrix();
kmGLLoadMatrix(&_modelViewTransform);
Director* director = Director::getInstance();
CCASSERT(nullptr != director, "Director is null when seting matrix stack");
director->pushMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
director->loadMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW, _modelViewTransform);
this->beforeDraw();
@ -610,7 +612,7 @@ void ScrollView::visit(Renderer *renderer, const kmMat4 &parentTransform, bool p
this->afterDraw();
kmGLPopMatrix();
director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW);
}
bool ScrollView::onTouchBegan(Touch* touch, Event* event)