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

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

Issue 1972213003: [DevTools] More UX fixes in Device Mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
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 e581a57a6b5dd22fa1dbc7a3313352f23f105fbd..b5951eee8eab64e92044e3c616a99e8ee9bf1fea 100644
--- a/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
+++ b/third_party/WebKit/Source/devtools/front_end/emulation/DeviceModeView.js
@@ -454,13 +454,17 @@ WebInspector.DeviceModeView.prototype = {
*/
function paintScreenshot()
{
+ ctx.strokeStyle = "hsla(0, 0%, 98%, 0.5)";
+ ctx.lineWidth = 1;
+ ctx.setLineDash([10, 10]);
+ ctx.strokeRect(screenRect.left + 1, screenRect.top + 1, screenRect.width - 2, screenRect.height - 2);
var pageImage = new Image();
pageImage.src = "data:image/png;base64," + content;
ctx.drawImage(pageImage,
visiblePageRect.left,
visiblePageRect.top,
- visiblePageRect.width,
- visiblePageRect.height);
+ Math.min(pageImage.naturalWidth, screenRect.width),
+ Math.min(pageImage.naturalHeight, screenRect.height));
var mainFrame = mainTarget.resourceTreeModel.mainFrame;
var fileName = mainFrame ? mainFrame.url.trimURL().removeURLFragment() : "";
if (this._model.type() === WebInspector.DeviceModeModel.Type.Device)

Powered by Google App Engine
This is Rietveld 408576698