mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 02:02:41 +08:00
Fix the incorrect orientation of the gravity sensor and JSVM crash issue in HarmonyOS Next (#18041)
* 1.Fix the problem of incorrect rotation direction of openharmony screen 2.Remove redundant files # Conflicts: # templates/harmonyos-next/entry/src/main/ets/cocos/jsb-adapter/sys-ability-polyfill.js * Fix the issue of JSVM running crash --------- Co-authored-by: qiuguohua <guohua.qiu@cocos.com>
This commit is contained in:
@@ -52,7 +52,6 @@ enum ContextType {
|
||||
ENGINE_UTILS,
|
||||
EDITBOX_UTILS,
|
||||
WEBVIEW_UTILS,
|
||||
SYSTEM_UTILS,
|
||||
DISPLAY_UTILS,
|
||||
UV_ASYNC_SEND,
|
||||
VIDEO_UTILS
|
||||
@@ -226,13 +225,13 @@ static void napiOnDisplayChange(const Napi::CallbackInfo &info) {
|
||||
orientation = static_cast<int>(cc::IScreen::Orientation::PORTRAIT);
|
||||
break;
|
||||
case 1: // ROTATION_90
|
||||
orientation = static_cast<int>(cc::IScreen::Orientation::LANDSCAPE_RIGHT);
|
||||
orientation = static_cast<int>(cc::IScreen::Orientation::LANDSCAPE_LEFT);
|
||||
break;
|
||||
case 2: // ROTATION_180
|
||||
orientation = static_cast<int>(cc::IScreen::Orientation::PORTRAIT_UPSIDE_DOWN);
|
||||
break;
|
||||
case 3: // ROTATION_270
|
||||
orientation = static_cast<int>(cc::IScreen::Orientation::LANDSCAPE_LEFT);
|
||||
orientation = static_cast<int>(cc::IScreen::Orientation::LANDSCAPE_RIGHT);
|
||||
break;
|
||||
}
|
||||
cc::events::Orientation::broadcast(orientation);
|
||||
|
||||
Reference in New Issue
Block a user