Title: [146591] trunk/Source/WebCore
Revision
146591
Author
loi...@chromium.org
Date
2013-03-22 05:04:53 -0700 (Fri, 22 Mar 2013)

Log Message

Web Inspector: Flame Chart. Chart has to be zoomed around the mouse pointer.
https://bugs.webkit.org/show_bug.cgi?id=113031

Reviewed by Yury Semikhatsky.

Overview grid is able to zoom around the mouse pointer.
So the simplest way is to translate x coordinate of the mouse pointer hovered over the chart
to x coordinate in term of overview window and pass it to the zoom function.

Minor unrelated fix: draw small border at bottom of the overview grid.

* inspector/front-end/FlameChart.js:
(WebInspector.FlameChart.prototype._onMouseWheel):
* inspector/front-end/OverviewGrid.js:
(WebInspector.OverviewGrid.prototype.zoom):
* inspector/front-end/flameChart.css:
(#flame-chart-overview-container):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (146590 => 146591)


--- trunk/Source/WebCore/ChangeLog	2013-03-22 11:58:21 UTC (rev 146590)
+++ trunk/Source/WebCore/ChangeLog	2013-03-22 12:04:53 UTC (rev 146591)
@@ -1,3 +1,23 @@
+2013-03-22  Ilya Tikhonovsky  <loi...@chromium.org>
+
+        Web Inspector: Flame Chart. Chart has to be zoomed around the mouse pointer.
+        https://bugs.webkit.org/show_bug.cgi?id=113031
+
+        Reviewed by Yury Semikhatsky.
+
+        Overview grid is able to zoom around the mouse pointer.
+        So the simplest way is to translate x coordinate of the mouse pointer hovered over the chart
+        to x coordinate in term of overview window and pass it to the zoom function.
+
+        Minor unrelated fix: draw small border at bottom of the overview grid.
+
+        * inspector/front-end/FlameChart.js:
+        (WebInspector.FlameChart.prototype._onMouseWheel):
+        * inspector/front-end/OverviewGrid.js:
+        (WebInspector.OverviewGrid.prototype.zoom):
+        * inspector/front-end/flameChart.css:
+        (#flame-chart-overview-container):
+
 2013-03-22  No'am Rosenthal  <n...@webkit.org>
 
         [Texmap] TextureMapperImageBuffer should not use rendering code for filters.

Modified: trunk/Source/WebCore/inspector/front-end/FlameChart.js (146590 => 146591)


--- trunk/Source/WebCore/inspector/front-end/FlameChart.js	2013-03-22 11:58:21 UTC (rev 146590)
+++ trunk/Source/WebCore/inspector/front-end/FlameChart.js	2013-03-22 12:04:53 UTC (rev 146591)
@@ -436,7 +436,9 @@
     _onMouseWheel: function(e)
     {
         var zoomFactor = (e.wheelDelta > 0) ? 0.9 : 1.1;
-        this._overviewGrid.zoom(zoomFactor);
+        var windowPoint = (this._pixelWindowLeft + e.offsetX) / this._totalPixels;
+        var overviewReferencePoint = Math.floor(windowPoint * this._pixelWindowWidth);
+        this._overviewGrid.zoom(zoomFactor, overviewReferencePoint);
         this._hidePopover();
     },
 

Modified: trunk/Source/WebCore/inspector/front-end/OverviewGrid.js (146590 => 146591)


--- trunk/Source/WebCore/inspector/front-end/OverviewGrid.js	2013-03-22 11:58:21 UTC (rev 146590)
+++ trunk/Source/WebCore/inspector/front-end/OverviewGrid.js	2013-03-22 12:04:53 UTC (rev 146591)
@@ -152,10 +152,11 @@
 
     /**
      * @param {!number} zoomFactor
+     * @param {!number} referencePoint
      */
-    zoom: function(zoomFactor)
+    zoom: function(zoomFactor, referencePoint)
     {
-        this._window._zoom(zoomFactor);
+        this._window._zoom(zoomFactor, referencePoint);
     }
 }
 
@@ -436,7 +437,7 @@
 
     /**
      * @param {number} factor
-     * @param {number=} referencePoint
+     * @param {number} referencePoint
      */
     _zoom: function(factor, referencePoint)
     {

Modified: trunk/Source/WebCore/inspector/front-end/flameChart.css (146590 => 146591)


--- trunk/Source/WebCore/inspector/front-end/flameChart.css	2013-03-22 11:58:21 UTC (rev 146590)
+++ trunk/Source/WebCore/inspector/front-end/flameChart.css	2013-03-22 12:04:53 UTC (rev 146591)
@@ -22,3 +22,7 @@
 #flame-chart-overview-grid .resources-dividers-label-bar {
     pointer-events: auto;
 }
+
+#flame-chart-overview-container {
+    border-bottom: 1px solid rgba(0, 0, 0, 0.3);
+}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to