Fix position of x axis labels (#50)

This was broken by #48
This commit is contained in:
Jamie Wong
2018-05-29 13:46:14 -07:00
committed by GitHub
parent b8e437ec3e
commit 9cdda3abf6
+2
View File
@@ -207,6 +207,7 @@ export class FlamechartPanZoomView extends ReloadableComponent<FlamechartPanZoom
ctx.font = `${physicalViewSpaceFontSize}px/${physicalViewSpaceFrameHeight}px ${
FontFamily.MONOSPACE
}`
ctx.textBaseline = 'alphabetic'
ctx.fillStyle = Colors.DARK_GRAY
const minWidthToRender = cachedMeasureTextWidth(ctx, 'M' + ELLIPSIS + 'M')
@@ -358,6 +359,7 @@ export class FlamechartPanZoomView extends ReloadableComponent<FlamechartPanZoom
ctx.fillStyle = 'rgba(255, 255, 255, 0.8)'
ctx.fillRect(0, 0, physicalViewSize.x, physicalViewSpaceFrameHeight)
ctx.fillStyle = Colors.GRAY
ctx.textBaseline = 'top'
for (let x = Math.ceil(left / interval) * interval; x < right; x += interval) {
// TODO(jlfwong): Ensure that labels do not overlap
const pos = Math.round(configToPhysical.transformPosition(new Vec2(x, 0)).x)