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

Unified Diff: Source/devtools/front_end/FlameChart.js

Issue 187303003: FlameChart: REGRESSION zoom doesn't work properly when time window has its initial values. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/FlameChart.js
diff --git a/Source/devtools/front_end/FlameChart.js b/Source/devtools/front_end/FlameChart.js
index d4aeffbb2bc66237ae6ac96208b5ff55d6ef5e01..b7aa0936ef1da7865b191851a9df3eed71a60824 100644
--- a/Source/devtools/front_end/FlameChart.js
+++ b/Source/devtools/front_end/FlameChart.js
@@ -425,15 +425,6 @@ WebInspector.FlameChart.OverviewPane = function(dataProvider)
WebInspector.FlameChart.OverviewPane.prototype = {
/**
- * @param {number} zoom
- * @param {number} referencePoint
- */
- zoom: function(zoom, referencePoint)
- {
- this._overviewGrid.zoom(zoom, referencePoint);
- },
-
- /**
* @param {number} windowStartTime
* @param {number} windowEndTime
*/
@@ -736,14 +727,15 @@ WebInspector.FlameChart.MainPane.prototype = {
*/
_onMouseWheel: function(e)
{
- var windowLeft = this._timeWindowLeft;
- var windowRight = this._timeWindowRight;
+ var windowLeft = this._timeWindowLeft ? this._timeWindowLeft : this._dataProvider.zeroTime();
pfeldman 2014/03/05 05:33:50 I think using -1 for default values is more approp
+ var windowRight = this._timeWindowRight !== Infinity ? this._timeWindowRight : this._dataProvider.zeroTime() + this._dataProvider.totalTime();
+
if (e.wheelDeltaY) {
const mouseWheelZoomSpeed = 1 / 120;
var zoom = Math.pow(1.2, -e.wheelDeltaY * mouseWheelZoomSpeed) - 1;
var cursorTime = this._cursorTime(e.offsetX);
- windowLeft += (this._timeWindowLeft - cursorTime) * zoom;
- windowRight += (this._timeWindowRight - cursorTime) * zoom;
+ windowLeft += (windowLeft - cursorTime) * zoom;
+ windowRight += (windowRight - cursorTime) * zoom;
} else {
var shift = e.wheelDeltaX * this._pixelToTime;
shift = Number.constrain(shift, this._zeroTime - windowLeft, this._totalTime + this._zeroTime - windowRight);
« 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