Commit 6b4a541c authored by Camillo Bruni's avatar Camillo Bruni Committed by V8 LUCI CQ

[tools][system-analyzer] Fix timeline scaling

- Make sure the viewport size of the svg is adjusted properly when
  scaling
- Fix an off-by-one when calculating Chunk groups

Bug: v8:10644
Change-Id: I56e857a8aa1a67e408bcfb08ed126e6bfdb0ce1b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3641177
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarPatrick Thier <pthier@chromium.org>
Commit-Queue: Patrick Thier <pthier@chromium.org>
Auto-Submit: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80473}
parent 25072178
......@@ -3,11 +3,11 @@
// found in the LICENSE file.
export class Group {
constructor(key, id, parentTotal, entries) {
constructor(key, id, parentTotal, entries, length = 0) {
this.key = key;
this.id = id;
this.entries = entries;
this.length = entries.length;
this.length = length || entries.length;
this.parentTotal = parentTotal;
}
......@@ -41,7 +41,7 @@ export function groupBy(array, keyFunction, collect = false) {
continue;
}
let entries = collect ? [each] : sharedEmptyArray;
group = new Group(key, id++, array.length, entries);
group = new Group(key, id++, array.length, entries, 1);
groups.push(group);
keyToGroup.set(key, group);
}
......
......@@ -244,6 +244,7 @@ export class TimelineTrackBase extends V8CustomElement {
this.hitPanelNode.style.width = `${width}px`;
const ratio = this._scaleContent(width) || 1;
this.timelineChunks.style.width = `${width / Math.min(1, ratio)}px`;
this._drawMarkers();
this._selectionHandler.update();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment