From: Jacob Casper Date: Sat, 25 Apr 2020 20:50:01 +0000 (-0500) Subject: Fix infinite bracket on genre with one artist X-Git-Url: https://git.jacobcasper.com/?a=commitdiff_plain;h=e4763c42daa05515fb25e94047803de3c3716a4a;p=brackets.git Fix infinite bracket on genre with one artist --- diff --git a/frontend/index.js b/frontend/index.js index 838b623..d70de4f 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -135,7 +135,10 @@ const drawBracket = (canvas, artists, genre) => { context.textAlign = "start"; const [rect_width, rect_height] = getRectangleDimensions(canvas); const groups = 4; - const rounds = Math.floor(Math.log2(artists.length / groups)); + const rounds = Math.max( + Math.floor(Math.log2(artists.length / groups)), + 1 + ); for (let group = 1; group <= groups; group++) { drawMatchup( canvas,