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

Unified Diff: third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js

Issue 1995123002: Revert of DevTools: Add inertia to flamechart dragging. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
index c6b7f179d090bd0d2807720123dd4c3b123e9472..6656be84acd6cd20febc72ad7abf04d83693200b 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js
@@ -74,7 +74,7 @@
this._canvas.addEventListener("mousewheel", this._onMouseWheel.bind(this), false);
this._canvas.addEventListener("click", this._onClick.bind(this), false);
this._canvas.addEventListener("keydown", this._onKeyDown.bind(this), false);
- WebInspector.installInertialDragHandle(this._canvas, this._startCanvasDragging.bind(this), this._canvasDragging.bind(this), this._endCanvasDragging.bind(this), "-webkit-grabbing", null);
+ WebInspector.installDragHandle(this._canvas, this._startCanvasDragging.bind(this), this._canvasDragging.bind(this), this._endCanvasDragging.bind(this), "-webkit-grabbing", null);
WebInspector.installDragHandle(this._canvas, this._startRangeSelection.bind(this), this._rangeSelectionDragging.bind(this), this._endRangeSelection.bind(this), "text", null);
this._vScrollElement = this.contentElement.createChild("div", "flame-chart-v-scroll");
@@ -632,13 +632,12 @@
},
/**
- * @param {number} x
- * @param {number} y
- */
- _updateMaxDragOffset: function(x, y)
- {
- var dx = x - this._dragStartX;
- var dy = y - this._dragStartY;
+ * @param {!MouseEvent} event
+ */
+ _updateMaxDragOffset: function(event)
+ {
+ var dx = event.pageX - this._dragStartX;
+ var dy = event.pageY - this._dragStartY;
var dragOffsetSquared = dx * dx + dy * dy;
this._maxDragOffsetSquared = Math.max(this._maxDragOffsetSquared, dragOffsetSquared);
},
@@ -652,12 +651,10 @@
},
/**
- * @param {number} x
- * @param {number} y
* @param {!MouseEvent} event
* @return {boolean}
*/
- _startCanvasDragging: function(x, y, event)
+ _startCanvasDragging: function(event)
{
if (event.shiftKey)
return false;
@@ -665,29 +662,30 @@
return false;
this._isDragging = true;
this._initMaxDragOffset(event);
- this._dragStartPointX = x;
- this._dragStartPointY = y;
+ this._dragStartPointX = event.pageX;
+ this._dragStartPointY = event.pageY;
this._dragStartScrollTop = this._vScrollElement.scrollTop;
+ this._dragStartWindowLeft = this._timeWindowLeft;
+ this._dragStartWindowRight = this._timeWindowRight;
this._canvas.style.cursor = "";
this.hideHighlight();
return true;
},
/**
- * @param {number} x
- * @param {number} y
- */
- _canvasDragging: function(x, y)
- {
- var pixelShift = this._dragStartPointX - x;
- this._dragStartPointX = x;
+ * @param {!MouseEvent} event
+ */
+ _canvasDragging: function(event)
+ {
+ var pixelShift = this._dragStartPointX - event.pageX;
+ this._dragStartPointX = event.pageX;
this._muteAnimation = true;
this._handlePanGesture(pixelShift * this._pixelToTime);
this._muteAnimation = false;
- var pixelScroll = this._dragStartPointY - y;
+ var pixelScroll = this._dragStartPointY - event.pageY;
this._vScrollElement.scrollTop = this._dragStartScrollTop + pixelScroll;
- this._updateMaxDragOffset(x, y);
+ this._updateMaxDragOffset(event);
},
_endCanvasDragging: function()
@@ -734,7 +732,7 @@
*/
_rangeSelectionDragging: function(event)
{
- this._updateMaxDragOffset(event.pageX, event.pageY);
+ this._updateMaxDragOffset(event);
var x = Number.constrain(event.pageX + this._selectionOffsetShiftX, 0, this._offsetWidth);
var start = this._cursorTime(this._selectionStartX);
var end = this._cursorTime(x);
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui/UIUtils.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698