| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |