Merge "perfetto-ui: Fix canvas limit px"
diff --git a/src/trace_processor/trace_storage.cc b/src/trace_processor/trace_storage.cc
index 74d22bf..b8d79f4 100644
--- a/src/trace_processor/trace_storage.cc
+++ b/src/trace_processor/trace_storage.cc
@@ -150,12 +150,6 @@
DbTableMaybeUpdateMinMax(heap_graph_object_table_.graph_sample_ts(),
&start_ns, &end_ns);
- if (heap_graph_object_table_.row_count() != 0) {
- // TODO(fmayer): Remove this.
- // Work around UI bug that the heap marker is not displayed.
- end_ns += 50000000; // 50 ms
- }
-
if (start_ns == std::numeric_limits<int64_t>::max()) {
return std::make_pair(0, 0);
}
diff --git a/ui/src/frontend/panel_container.ts b/ui/src/frontend/panel_container.ts
index 3c2e31f..8698422 100644
--- a/ui/src/frontend/panel_container.ts
+++ b/ui/src/frontend/panel_container.ts
@@ -245,12 +245,7 @@
}
const dpr = window.devicePixelRatio;
- // On non-MacOS if there is a solid scroll bar it can cover important
- // pixels, reduce the size of the canvas so it doesn't overlap with
- // the scroll bar.
- ctx.canvas.width =
- (this.parentWidth - globals.frontendLocalState.getScrollbarWidth()) *
- dpr;
+ ctx.canvas.width = this.parentWidth * dpr;
ctx.canvas.height = this.canvasHeight * dpr;
ctx.scale(dpr, dpr);
}
@@ -270,7 +265,11 @@
const oldWidth = this.parentWidth;
const oldHeight = this.parentHeight;
const clientRect = assertExists(dom.parentElement).getBoundingClientRect();
- this.parentWidth = clientRect.width;
+ // On non-MacOS if there is a solid scroll bar it can cover important
+ // pixels, reduce the size of the canvas so it doesn't overlap with
+ // the scroll bar.
+ this.parentWidth =
+ clientRect.width - globals.frontendLocalState.getScrollbarWidth();
this.parentHeight = clientRect.height;
return this.parentHeight !== oldHeight || this.parentWidth !== oldWidth;
}
diff --git a/ui/src/frontend/viewer_page.ts b/ui/src/frontend/viewer_page.ts
index 5dd811e..aa8d0c4 100644
--- a/ui/src/frontend/viewer_page.ts
+++ b/ui/src/frontend/viewer_page.ts
@@ -132,7 +132,10 @@
const frontendLocalState = globals.frontendLocalState;
const updateDimensions = () => {
const rect = vnode.dom.getBoundingClientRect();
- frontendLocalState.updateResolution(0, rect.width - TRACK_SHELL_WIDTH);
+ frontendLocalState.updateResolution(
+ 0,
+ rect.width - TRACK_SHELL_WIDTH -
+ frontendLocalState.getScrollbarWidth());
};
updateDimensions();