Skip to content

Commit

Permalink
Dont scale deviceWidth that is already scaled
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnj committed Jul 27, 2023
1 parent d9f0d8c commit ffe0f78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/gather/gatherers/full-page-screenshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -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),
};
}
Expand Down

0 comments on commit ffe0f78

Please sign in to comment.