projects
/
brackets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
74f7e92
)
Fix infinite bracket on genre with one artist
author
Jacob Casper
<dev@jacobcasper.com>
Sat, 25 Apr 2020 20:50:01 +0000
(15:50 -0500)
committer
Jacob Casper
<dev@jacobcasper.com>
Sat, 25 Apr 2020 20:50:01 +0000
(15:50 -0500)
frontend/index.js
patch
|
blob
|
blame
|
history
diff --git
a/frontend/index.js
b/frontend/index.js
index
838b623
..
d70de4f
100644
(file)
--- 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,