Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(908)

Unified Diff: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js

Issue 2811273004: [DevTools] Account for host device pixel ratio in Device Mode screenshots (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
diff --git a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
index 907fa811df973fc8c89b1475dd6b5de7476ec353..04e9011877590f1c69e7b574a105f04b159dad13 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
@@ -372,7 +372,7 @@ Emulation.DeviceModeView = class extends UI.VBox {
var pageImage = new Image();
pageImage.src = 'data:image/png;base64,' + screenshot;
pageImage.onload = async () => {
- var scale = 1 / this._model.scale();
+ var scale = window.devicePixelRatio / this._model.scale();
var outlineRect = this._model.outlineRect().scale(scale);
var screenRect = this._model.screenRect().scale(scale);
var visiblePageRect = this._model.visiblePageRect().scale(scale);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698