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

Unified Diff: Source/devtools/front_end/toolbox/ResponsiveDesignView.js

Issue 387373004: Revert of Revert of [DevTools] Device mode: reset page scale when enabling and improve UI. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | « Source/devtools/front_end/sdk/OverridesSupport.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/toolbox/ResponsiveDesignView.js
diff --git a/Source/devtools/front_end/toolbox/ResponsiveDesignView.js b/Source/devtools/front_end/toolbox/ResponsiveDesignView.js
index 2a26da9a5c3a4d6cf9fe762302af38df2267b340..d44c7021313a8de74089af49ab6518683bcd50c0 100644
--- a/Source/devtools/front_end/toolbox/ResponsiveDesignView.js
+++ b/Source/devtools/front_end/toolbox/ResponsiveDesignView.js
@@ -238,7 +238,7 @@
const darkLineColor = "rgb(114, 114, 114)";
const rulerColor = "rgb(125, 125, 125)";
const textColor = "rgb(186, 186, 186)";
- const contentsSizeColor = "rgba(128, 128, 128, 0.5)";
+ const contentsSizeColor = "rgba(0, 0, 0, 0.3)";
var scale = (this._scale || 1) * this._viewport.pageScaleFactor;
var rulerScale = 0.5;
@@ -369,7 +369,8 @@
context.translate(-0.5, -0.5);
// Draw contents size.
- if (this._drawContentsSize) {
+ var pageScaleAvailable = WebInspector.overridesSupport.settings.emulateMobile.get() || WebInspector.overridesSupport.settings.emulateTouch.get();
+ if (this._drawContentsSize && pageScaleAvailable) {
context.fillStyle = contentsSizeColor;
var visibleContentsWidth = Math.max(0, Math.min(dipGridWidth, this._viewport.contentsWidth * scale - dipScrollX));
var visibleContentsHeight = Math.max(0, Math.min(dipGridHeight, this._viewport.contentsHeight * scale - dipScrollY));
« no previous file with comments | « Source/devtools/front_end/sdk/OverridesSupport.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698