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

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

Issue 2472063003: [Devtools] Adjusted font size for new network timeline (Closed)
Patch Set: Created 4 years, 1 month 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/network/NetworkTimelineColumn.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 44ceca596bdcd3776ee35df2e599a4b93ada446a..5185b3f5de4ac2abffcd3757c4fe898dc55f7bf0 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
@@ -98,8 +98,10 @@ WebInspector.TimelineGrid = class {
* @param {!WebInspector.TimelineGrid.Calculator} calculator
* @param {number} paddingTop
* @param {number=} freeZoneAtLeft
+ * @param {number=} freeZoneAtRight
+ * @param {string=} fontSize
*/
- static drawCanvasGrid(context, calculator, paddingTop, freeZoneAtLeft) {
+ static drawCanvasGrid(context, calculator, paddingTop, freeZoneAtLeft, freeZoneAtRight, fontSize) {
context.save();
var ratio = window.devicePixelRatio;
context.scale(ratio, ratio);
@@ -115,19 +117,22 @@ WebInspector.TimelineGrid = class {
context.fillStyle = '#333';
context.strokeStyle = 'rgba(0, 0, 0, 0.1)';
context.textBaseline = 'hanging';
- context.font = '11px ' + WebInspector.fontFamily();
+ if (!fontSize)
+ fontSize = '11px';
+ context.font = fontSize + ' ' + WebInspector.fontFamily();
context.lineWidth = 1;
context.translate(0.5, 0.5);
const paddingRight = 4;
freeZoneAtLeft = freeZoneAtLeft || 0;
+ freeZoneAtRight = freeZoneAtRight || 0;
for (var i = 0; i < dividerOffsets.length; ++i) {
var time = dividerOffsets[i];
var position = calculator.computePosition(time);
var text = calculator.formatValue(time, precision);
var textWidth = context.measureText(text).width;
var textPosition = position - textWidth - paddingRight;
- if (freeZoneAtLeft < textPosition)
+ if (freeZoneAtLeft < textPosition && width - freeZoneAtRight > textPosition + textWidth)
context.fillText(text, textPosition, paddingTop);
context.moveTo(position, 0);
context.lineTo(position, height);
« no previous file with comments | « third_party/WebKit/Source/devtools/front_end/network/NetworkTimelineColumn.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698