diff --git a/cocos/2d/CCLabel.cpp b/cocos/2d/CCLabel.cpp index 343508c6b4..66bd184470 100644 --- a/cocos/2d/CCLabel.cpp +++ b/cocos/2d/CCLabel.cpp @@ -79,6 +79,15 @@ public: float y1 = _offsetPosition.y; float x2 = x1 + size.width; float y2 = y1 + size.height; + if (_flippedX) + { + std::swap(x1, x2); + } + if (_flippedY) + { + std::swap(y1, y2); + } + float x = _transformToBatch.m[12]; float y = _transformToBatch.m[13]; diff --git a/tests/game-controller-test/Classes/GameControllerTest.cpp b/tests/game-controller-test/Classes/GameControllerTest.cpp index 55f9f8edee..aa4ef39e6d 100644 --- a/tests/game-controller-test/Classes/GameControllerTest.cpp +++ b/tests/game-controller-test/Classes/GameControllerTest.cpp @@ -414,7 +414,7 @@ void GameControllerTest::createControllerSprite(ControllerHolder& holder) holder._holderNode->addChild(buttonL2); auto buttonR2 = Sprite::create("R2.png"); - buttonR2->setPosition(98-220,910); + buttonR2->setPosition(998-220,910); holder._holderNode->addChild(buttonR2); holder._buttonL2 = Sprite::create("L2.png");