diff --git a/cocos2d/core/platform/CCInputExtension.js b/cocos2d/core/platform/CCInputExtension.js index d71fa2234e..3bee4aaa70 100644 --- a/cocos2d/core/platform/CCInputExtension.js +++ b/cocos2d/core/platform/CCInputExtension.js @@ -146,6 +146,11 @@ inputManager.didAccelerate = function (eventData) { z = (eventData["alpha"] / 90) * 0.981; } + if (cc.view._isRotated) { + let tmp = x; + x = -y; + y = tmp; + } mAcceleration.x = x; mAcceleration.y = y; mAcceleration.z = z;