From ffe0f783b92b3938a9c0c89b5fd5dbc8677fb659 Mon Sep 17 00:00:00 2001 From: "Alex N. Jose" Date: Wed, 26 Jul 2023 21:13:18 -0700 Subject: [PATCH] Dont scale deviceWidth that is already scaled --- core/gather/gatherers/full-page-screenshot.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/gather/gatherers/full-page-screenshot.js b/core/gather/gatherers/full-page-screenshot.js index 1f82e9eb92ac..791ef2344a90 100644 --- a/core/gather/gatherers/full-page-screenshot.js +++ b/core/gather/gatherers/full-page-screenshot.js @@ -123,10 +123,10 @@ class FullPageScreenshot extends BaseGatherer { const data = 'data:image/webp;base64,' + result.data; return { data, + // Rely on device metrics width that is already in scaled units to account for scrollbar on macOS. + width: deviceMetrics.width, // Since we resized emulated viewport to match the desired screenshot size, // it is safe to rely on scaled visual viewport css dimensions. - // Rely on device metrics width to account for scrollbar on macOS. - width: Math.round(deviceMetrics.width * metrics.cssVisualViewport.scale), height: Math.round(metrics.cssVisualViewport.clientHeight * metrics.cssVisualViewport.scale), }; }