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