From 9cbd40ab46c68303d215ca8c51627c8588648750 Mon Sep 17 00:00:00 2001 From: Bo-Rong Chen Date: Fri, 15 Nov 2024 13:56:51 -0800 Subject: [PATCH] [android] Fix wrong viewport on player Force the device to have scale factor of 1, so that it won't rescale the webpage, which fixed: 1. wrong viewport on player. 2. wrong x and y positions for Shorts. b/375224024 b/378156942 --- .../apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java index 15477ec2539..c23dfc0e083 100644 --- a/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java +++ b/cobalt/android/apk/app/src/main/java/dev/cobalt/coat/CobaltActivity.java @@ -120,7 +120,9 @@ protected void createContent(final Bundle savedInstanceState) { // Remove below if Cobalt rebase to m120+. "--user-level-memory-pressure-signal-params", // Pass javascript console log to adb log. - "--enable-features=LogJsConsoleMessages" + "--enable-features=LogJsConsoleMessages", + // Disable rescaling Webpage. + "--force-device-scale-factor=1", }; CommandLine.getInstance().appendSwitchesAndArguments(cobaltCommandLineParams);