mirror of https://github.com/axmolengine/axmol.git
migrate ScrollView to director matrix stack
This commit is contained in:
parent
960ac300d5
commit
bb19e39e37
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue