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

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

Issue 2024163004: [DevTools] Adjust device mode rulers when using small scale. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 */ 8 */
9 WebInspector.DeviceModeView = function() 9 WebInspector.DeviceModeView = function()
10 { 10 {
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 541
542 var dipSize = size * zoomFactor / this._scale; 542 var dipSize = size * zoomFactor / this._scale;
543 var count = Math.ceil(dipSize / 5); 543 var count = Math.ceil(dipSize / 5);
544 var step = 1; 544 var step = 1;
545 if (this._scale < 0.8) 545 if (this._scale < 0.8)
546 step = 2; 546 step = 2;
547 if (this._scale < 0.6) 547 if (this._scale < 0.6)
548 step = 4; 548 step = 4;
549 if (this._scale < 0.4) 549 if (this._scale < 0.4)
550 step = 8; 550 step = 8;
551 if (this._scale < 0.2)
552 step = 16;
553 if (this._scale < 0.1)
554 step = 32;
551 555
552 for (var i = count; i < this._count; i++) { 556 for (var i = count; i < this._count; i++) {
553 if (!(i % step)) 557 if (!(i % step))
554 this._contentElement.lastChild.remove(); 558 this._contentElement.lastChild.remove();
555 } 559 }
556 560
557 for (var i = this._count; i < count; i++) { 561 for (var i = this._count; i < count; i++) {
558 if (i % step) 562 if (i % step)
559 continue; 563 continue;
560 var marker = this._contentElement.createChild("div", "device-mode-ru ler-marker"); 564 var marker = this._contentElement.createChild("div", "device-mode-ru ler-marker");
(...skipping 21 matching lines...) Expand all
582 /** 586 /**
583 * @param {number} size 587 * @param {number} size
584 */ 588 */
585 _onMarkerClick: function(size) 589 _onMarkerClick: function(size)
586 { 590 {
587 this._applyCallback.call(null, size); 591 this._applyCallback.call(null, size);
588 }, 592 },
589 593
590 __proto__: WebInspector.VBox.prototype 594 __proto__: WebInspector.VBox.prototype
591 } 595 }
OLDNEW
« 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