From 8368928ab2c4bcd307312aed057ba572849f56a2 Mon Sep 17 00:00:00 2001 From: katspaugh <381895+katspaugh@users.noreply.github.com> Date: Sun, 15 Dec 2024 09:47:06 +0100 Subject: [PATCH] Fix: invalid array length in renderer (#3961) --- src/renderer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/renderer.ts b/src/renderer.ts index f86e3ea5e..1368f5fb9 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -528,6 +528,9 @@ class Renderer extends EventEmitter { let singleCanvasWidth = Math.min(Renderer.MAX_CANVAS_WIDTH, clientWidth, totalWidth) let drawnIndexes: Record = {} + // Nothing to render + if (singleCanvasWidth === 0) return + // Adjust width to avoid gaps between canvases when using bars if (options.barWidth || options.barGap) { const barWidth = options.barWidth || 0.5