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

Unified Diff: chrome/browser/resources/settings/device_page/display_layout.js

Issue 2522103002: MD Settings: Display: Fix runtime error (Closed)
Patch Set: Move test to display_layout.js Created 4 years, 1 month 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: chrome/browser/resources/settings/device_page/display_layout.js
diff --git a/chrome/browser/resources/settings/device_page/display_layout.js b/chrome/browser/resources/settings/device_page/display_layout.js
index d2b4623f0fb631f891a1b57fda32ffc6d171fa49..5e080cf351f81d7f894d206d691c0d1e2be9e343 100644
--- a/chrome/browser/resources/settings/device_page/display_layout.js
+++ b/chrome/browser/resources/settings/device_page/display_layout.js
@@ -75,7 +75,7 @@ Polymer({
* @return {boolean} Whether the calculation was successful.
* @private
*/
- calculateVisualScale_() {
+ calculateVisualScale_: function() {
var displayAreaDiv = this.$.displayArea;
if (!displayAreaDiv || !displayAreaDiv.offsetWidth || !this.displays ||
!this.displays.length) {
@@ -215,7 +215,9 @@ Polymer({
Object.assign({}, calculatedBounds));
newBounds.left += Math.round(amount.x / this.visualScale);
newBounds.top += Math.round(amount.y / this.visualScale);
- newBounds = this.updateDisplayBounds(id, newBounds);
+
+ if (this.displays.length >= 2)
+ newBounds = this.updateDisplayBounds(id, newBounds);
}
var left =
this.visualOffset_.left + Math.round(newBounds.left * this.visualScale);

Powered by Google App Engine
This is Rietveld 408576698