Web Inspector: Zooming in on the Timeline should always zoom right where the cursor is
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Dec 2016 22:04:25 +0000 (22:04 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Dec 2016 22:04:25 +0000 (22:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=151118
<rdar://problem/23487912>

Reviewed by Timothy Hatcher.

Use correct left edge for timeline overview graph elements.

* UserInterface/Views/TimelineOverview.js:
(WebInspector.TimelineOverview.prototype._handleWheelEvent):
(WebInspector.TimelineOverview._handleGestureStart):
(WebInspector.TimelineOverview.prototype._handleGestureChange):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209834 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/TimelineOverview.js

index 2cf7faf..00e17ab 100644 (file)
@@ -1,3 +1,18 @@
+2016-12-14  Matt Baker  <mattbaker@apple.com>
+
+        Web Inspector: Zooming in on the Timeline should always zoom right where the cursor is
+        https://bugs.webkit.org/show_bug.cgi?id=151118
+        <rdar://problem/23487912>
+
+        Reviewed by Timothy Hatcher.
+
+        Use correct left edge for timeline overview graph elements.
+
+        * UserInterface/Views/TimelineOverview.js:
+        (WebInspector.TimelineOverview.prototype._handleWheelEvent):
+        (WebInspector.TimelineOverview._handleGestureStart):
+        (WebInspector.TimelineOverview.prototype._handleGestureChange):
+
 2016-12-12  Nikita Vasilyev  <nvasilyev@apple.com>
 
         [GTK] Web Inspector: Add NavigationItemCodeCoverage.svg icon
index 8e79fb1..9f09d01 100644 (file)
@@ -544,7 +544,7 @@ WebInspector.TimelineOverview = class TimelineOverview extends WebInspector.View
         }
 
         // Remember the mouse position in time.
-        let mouseOffset = event.pageX - this.element.totalOffsetLeft;
+        let mouseOffset = event.pageX - this._graphsContainerView.element.totalOffsetLeft;
         let mousePositionTime = this._currentSettings.scrollStartTime + (mouseOffset * this.secondsPerPixel);
         let deviceDirection = event.webkitDirectionInvertedFromDevice ? 1 : -1;
         let delta = event.deltaY * (this.secondsPerPixel / WebInspector.TimelineOverview.ScrollDeltaDenominator) * deviceDirection;
@@ -576,7 +576,7 @@ WebInspector.TimelineOverview = class TimelineOverview extends WebInspector.View
             return;
         }
 
-        let mouseOffset = event.pageX - this.element.totalOffsetLeft;
+        let mouseOffset = event.pageX - this._graphsContainerView.element.totalOffsetLeft;
         let mousePositionTime = this._currentSettings.scrollStartTime + (mouseOffset * this.secondsPerPixel);
 
         this._handlingGesture = true;
@@ -592,7 +592,7 @@ WebInspector.TimelineOverview = class TimelineOverview extends WebInspector.View
         // Cap zooming out at 5x.
         let scale = Math.max(1 / 5, event.scale);
 
-        let mouseOffset = event.pageX - this.element.totalOffsetLeft;
+        let mouseOffset = event.pageX - this._graphsContainerView.element.totalOffsetLeft;
         let newSecondsPerPixel = this._gestureStartDurationPerPixel / scale;
 
         this.secondsPerPixel = newSecondsPerPixel;