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

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

Issue 2596023002: DevTools: remove ruler bar from the main flamechart (Closed)
Patch Set: rebaseline Created 4 years 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_lazy/FlameChart.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/TimelineGrid.js
diff --git a/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js b/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js
index 871d15c629755f521f3c7a72bea327a9de0f0131..bc212bc97bdebda6ae1a423aa09bb1ce63baf741 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui_lazy/TimelineGrid.js
@@ -97,7 +97,7 @@ UI.TimelineGrid = class {
* @param {!CanvasRenderingContext2D} context
* @param {!UI.TimelineGrid.Calculator} calculator
* @param {number} paddingTop
- * @param {number} headerHeight
+ * @param {number=} headerHeight
* @param {number=} freeZoneAtLeft
*/
static drawCanvasGrid(context, calculator, paddingTop, headerHeight, freeZoneAtLeft) {
@@ -110,8 +110,10 @@ UI.TimelineGrid = class {
var dividerOffsets = dividersData.offsets;
var precision = dividersData.precision;
- context.fillStyle = UI.themeSupport.patchColor('rgba(255, 255, 255, 0.5)', UI.ThemeSupport.ColorUsage.Background);
- context.fillRect(0, 0, width, headerHeight);
+ if (headerHeight) {
+ context.fillStyle = UI.themeSupport.patchColor('rgba(255, 255, 255, 0.5)', UI.ThemeSupport.ColorUsage.Background);
+ context.fillRect(0, 0, width, headerHeight);
+ }
context.fillStyle = UI.themeSupport.patchColor('#333', UI.ThemeSupport.ColorUsage.Foreground);
context.strokeStyle = UI.themeSupport.patchColor('rgba(0, 0, 0, 0.1)', UI.ThemeSupport.ColorUsage.Foreground);
@@ -124,13 +126,15 @@ UI.TimelineGrid = class {
for (var i = 0; i < dividerOffsets.length; ++i) {
var time = dividerOffsets[i];
var position = calculator.computePosition(time);
+ context.moveTo(position, 0);
+ context.lineTo(position, height);
+ if (!headerHeight)
+ continue;
var text = calculator.formatValue(time, precision);
var textWidth = context.measureText(text).width;
var textPosition = position - textWidth - paddingRight;
if (!freeZoneAtLeft || freeZoneAtLeft < textPosition)
context.fillText(text, textPosition, paddingTop);
- context.moveTo(position, 0);
- context.lineTo(position, height);
}
context.stroke();
context.restore();
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/ui_lazy/FlameChart.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698