projects
/
brackets.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
59a851b
)
Center text instead of doing weird calculation
author
Jacob Casper
<dev@jacobcasper.com>
Sun, 19 Apr 2020 05:00:37 +0000
(
00:00
-0500)
committer
Jacob Casper
<dev@jacobcasper.com>
Sun, 19 Apr 2020 05:00:37 +0000
(
00:00
-0500)
frontend/index.js
patch
|
blob
|
blame
|
history
diff --git
a/frontend/index.js
b/frontend/index.js
index
6385dbe
..
423a641
100644
(file)
--- a/
frontend/index.js
+++ b/
frontend/index.js
@@
-130,7
+130,9
@@
const drawBracket = (canvas, artists, genre) => {
drawWinner(canvas);
const [mid_x, mid_y] = getCenter(canvas);
context.font = '28px sans serif'
- context.strokeText(genre.toUpperCase(), mid_x - (28 * (genre.length / 3)), 40);
+ context.textAlign = "center";
+ context.strokeText(genre.toUpperCase(), mid_x, 40);
+ context.textAlign = "start";
const [rect_width, rect_height] = getRectangleDimensions(canvas);
const groups = 4;
const rounds = Math.floor(Math.log2(artists.length / groups));