Skip to content

Commit

Permalink
Modifying the orientation of the openharmony sensor (cocos#16276)
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuguohua authored Sep 18, 2023
1 parent b58983b commit fe51209
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cocos2d/core/platform/CCInputExtension.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ inputManager.didAccelerate = function (eventData) {
mAcceleration.y = -mAcceleration.y;
}
// fix android acc values are opposite
if (cc.sys.os === cc.sys.OS_ANDROID &&
if ((cc.sys.os === cc.sys.OS_ANDROID || cc.sys.os === cc.sys.OS_OPENHARMONY) &&
cc.sys.browserType !== cc.sys.BROWSER_TYPE_MOBILE_QQ) {
mAcceleration.x = -mAcceleration.x;
mAcceleration.y = -mAcceleration.y;
Expand Down

0 comments on commit fe51209

Please sign in to comment.