fix FastTMXLayer (#20065)

This commit is contained in:
coulsonwang 2019-08-29 22:30:03 +08:00 committed by minggo
parent 66c4892b22
commit 73ad115702
1 changed files with 2 additions and 2 deletions

View File

@ -141,8 +141,8 @@ void TMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags)
{
Size s = Director::getInstance()->getVisibleSize();
const Vec2 &anchor = getAnchorPoint();
auto rect = Rect(Camera::getVisitingCamera()->getPositionX() - s.width * anchor.x,
Camera::getVisitingCamera()->getPositionY() - s.height * anchor.y,
auto rect = Rect(Camera::getVisitingCamera()->getPositionX() - s.width * (anchor.x == 0.0f ? 0.5f : anchor.x),
Camera::getVisitingCamera()->getPositionY() - s.height * (anchor.y == 0.0f ? 0.5f : anchor.y),
s.width,
s.height);