Skip to content

Commit

Permalink
perforator: do not miss root when resizing window
Browse files Browse the repository at this point in the history
commit_hash:06a5a656d046239fc5071f4d9298fe59c4e785d5
  • Loading branch information
gearoffortune committed Feb 5, 2025
1 parent 0b086f6 commit 79e5021
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,13 @@ export const renderFlamegraph: RenderFlamegraphType = (
render({ pattern: searchPattern, subtree: { initialH: h, initialI: pos } });

const onResize = () => requestAnimationFrame(() => {

const initialH = Number(getState('frameDepth', '0'));
const initialI = Number(getState('framePos', '0'));
//@ts-ignore
canvas.style.width = null;
initCanvas();
render({ pattern: searchPattern });
render({ subtree: { initialH, initialI }, pattern: searchPattern });
});
window.addEventListener('resize', onResize);

Expand Down

0 comments on commit 79e5021

Please sign in to comment.