diff --git a/tinygrad/viz/js/index.js b/tinygrad/viz/js/index.js index 7f21456986..d78c73cff7 100644 --- a/tinygrad/viz/js/index.js +++ b/tinygrad/viz/js/index.js @@ -482,38 +482,38 @@ async function renderProfiler(path, unit, opts) { xscale.domain([st, et]); ctx.textBaseline = "middle"; // draw shapes - const paths = []; for (const [k, { shapes, eventType, visible, offsetY, valueMap, pcolor, scolor, rowBorderColor }] of data.tracks) { visible.length = 0; - const addBorder = scolor != null ? (p,w) => { if (w > 10) { ctx.strokeStyle = scolor; ctx.stroke(p); } } : null; + const addBorder = scolor != null ? (w) => { if (w > 10) { ctx.strokeStyle = scolor; ctx.stroke(); } } : null; for (const e of shapes) { - const p = new Path2D(); if (eventType === EventTypes.BUF) { // generic polygon if (e.x[0]>et || e.x.at(-1)=0; i--) p.lineTo(x[i], offsetY+e.y1[i]); - p.closePath(); - ctx.fillStyle = e.fillColor; ctx.fill(p); + for (let i=x.length-1; i>=0; i--) ctx.lineTo(x[i], offsetY+e.y1[i]); + ctx.closePath(); + ctx.fillStyle = e.fillColor; ctx.fill(); } else { // contiguous rect if (e.x>et || e.x+e.width