Merge pull request #19721 from Mee-gu/feature/ClippingNode

fix scissor rectangle setting
This commit is contained in:
minggo 2019-05-16 01:38:56 -07:00 committed by GitHub
commit 65fda3df81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions

View File

@ -76,10 +76,11 @@ void ClippingRectangleNode::onBeforeVisitScissor()
} }
const Point pos = convertToWorldSpace(Point(_clippingRegion.origin.x, _clippingRegion.origin.y)); const Point pos = convertToWorldSpace(Point(_clippingRegion.origin.x, _clippingRegion.origin.y));
renderer->setScissorRect(pos.x, GLView* glView = Director::getInstance()->getOpenGLView();
pos.y, glView->setScissorInPoints(pos.x,
_clippingRegion.size.width * scaleX, pos.y,
_clippingRegion.size.height * scaleY); _clippingRegion.size.width * scaleX,
_clippingRegion.size.height * scaleY);
} }
} }