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

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

Issue 456413003: DevTools: wheel-zoom on timeline makes overview window flicker. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/components/FlameChart.js
diff --git a/Source/devtools/front_end/components/FlameChart.js b/Source/devtools/front_end/components/FlameChart.js
index 488d542cf1482115a247df81487a6991eed6fdf8..56d9baa0b72e07fb74d2ab28bf427dc907dd0280 100644
--- a/Source/devtools/front_end/components/FlameChart.js
+++ b/Source/devtools/front_end/components/FlameChart.js
@@ -415,6 +415,16 @@ WebInspector.FlameChart.prototype = {
return this._rawTimelineData;
},
+ _cancelAnimation: function()
+ {
+ if (this._cancelWindowTimesAnimation) {
+ this._timeWindowLeft = this._pendingAnimationTimeLeft;
+ this._timeWindowRight = this._pendingAnimationTimeRight;
+ this._cancelWindowTimesAnimation();
+ delete this._cancelWindowTimesAnimation;
+ }
+ },
+
/**
* @param {number} startTime
* @param {number} endTime
@@ -429,11 +439,12 @@ WebInspector.FlameChart.prototype = {
return;
}
- if (this._cancelWindowTimesAnimation)
- this._cancelWindowTimesAnimation();
+ this._cancelAnimation();
this._cancelWindowTimesAnimation = WebInspector.animateFunction(this._animateWindowTimes.bind(this),
[{from: this._timeWindowLeft, to: startTime}, {from: this._timeWindowRight, to: endTime}], 5,
this._animationCompleted.bind(this));
+ this._pendingAnimationTimeLeft = startTime;
+ this._pendingAnimationTimeRight = endTime;
},
/**
@@ -599,6 +610,7 @@ WebInspector.FlameChart.prototype = {
*/
_handleZoomGesture: function(zoom)
{
+ this._cancelAnimation();
var bounds = this._windowForGesture();
var cursorTime = this._cursorTime(this._lastMouseOffsetX);
bounds.left += (bounds.left - cursorTime) * zoom;
@@ -611,6 +623,7 @@ WebInspector.FlameChart.prototype = {
*/
_handlePanGesture: function(shift)
{
+ this._cancelAnimation();
var bounds = this._windowForGesture();
shift = Number.constrain(shift, this._minimumBoundary - bounds.left, this._totalTime + this._minimumBoundary - bounds.right);
bounds.left += shift;
« 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