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

Side by Side Diff: Source/devtools/front_end/FlameChart.js

Issue 216613002: FlameChart: make flame chart vertically draggable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« 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 /** 1 /**
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 /** 348 /**
349 * @param {!MouseEvent} event 349 * @param {!MouseEvent} event
350 */ 350 */
351 _startCanvasDragging: function(event) 351 _startCanvasDragging: function(event)
352 { 352 {
353 if (!this._timelineData()) 353 if (!this._timelineData())
354 return false; 354 return false;
355 this._isDragging = true; 355 this._isDragging = true;
356 this._maxDragOffset = 0; 356 this._maxDragOffset = 0;
357 this._dragStartPoint = event.pageX; 357 this._dragStartPointX = event.pageX;
358 this._dragStartPointY = event.pageY;
359 this._dragStartScrollTop = this._vScrollElement.scrollTop;
358 this._dragStartWindowLeft = this._timeWindowLeft; 360 this._dragStartWindowLeft = this._timeWindowLeft;
359 this._dragStartWindowRight = this._timeWindowRight; 361 this._dragStartWindowRight = this._timeWindowRight;
360 this._canvas.style.cursor = ""; 362 this._canvas.style.cursor = "";
361 363
362 return true; 364 return true;
363 }, 365 },
364 366
365 /** 367 /**
366 * @param {!MouseEvent} event 368 * @param {!MouseEvent} event
367 */ 369 */
368 _canvasDragging: function(event) 370 _canvasDragging: function(event)
369 { 371 {
370 var pixelShift = this._dragStartPoint - event.pageX; 372 var pixelShift = this._dragStartPointX - event.pageX;
373 var pixelScroll = this._dragStartPointY - event.pageY;
374 this._vScrollElement.scrollTop = this._dragStartScrollTop + pixelScroll;
371 var windowShift = pixelShift / this._totalPixels; 375 var windowShift = pixelShift / this._totalPixels;
372 var windowTime = this._windowWidth * this._totalTime; 376 var windowTime = this._windowWidth * this._totalTime;
373 var timeShift = windowTime * pixelShift / this._pixelWindowWidth; 377 var timeShift = windowTime * pixelShift / this._pixelWindowWidth;
374 timeShift = Number.constrain( 378 timeShift = Number.constrain(
375 timeShift, 379 timeShift,
376 this._zeroTime - this._dragStartWindowLeft, 380 this._zeroTime - this._dragStartWindowLeft,
377 this._zeroTime + this._totalTime - this._dragStartWindowRight 381 this._zeroTime + this._totalTime - this._dragStartWindowRight
378 ); 382 );
379 var windowLeft = this._dragStartWindowLeft + timeShift; 383 var windowLeft = this._dragStartWindowLeft + timeShift;
380 var windowRight = this._dragStartWindowRight + timeShift; 384 var windowRight = this._dragStartWindowRight + timeShift;
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 reset: function() 809 reset: function()
806 { 810 {
807 this._highlightedEntryIndex = -1; 811 this._highlightedEntryIndex = -1;
808 this._selectedEntryIndex = -1; 812 this._selectedEntryIndex = -1;
809 this._textWidth = {}; 813 this._textWidth = {};
810 this.update(); 814 this.update();
811 }, 815 },
812 816
813 __proto__: WebInspector.HBox.prototype 817 __proto__: WebInspector.HBox.prototype
814 } 818 }
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