From: Jacob Casper Date: Sun, 19 Apr 2020 04:21:00 +0000 (-0500) Subject: Draw artist in direction based on group X-Git-Url: https://git.jacobcasper.com/?p=brackets.git;a=commitdiff_plain;h=0230aa11e0f67d6b39dd9b0b5dbf3e958f860720 Draw artist in direction based on group --- diff --git a/frontend/index.js b/frontend/index.js index c45341a..d49372f 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -77,7 +77,6 @@ const drawBranchFrom = (ctx, x, y, xDist, yDist, left, up) => { const drawArtistOnCtx = (ctx, artistName, x, y) => { ctx.font = "1em sans serif"; - ctx.direction = "ltr"; ctx.strokeText(artistName, x, y); } @@ -91,6 +90,7 @@ const drawMatchup = (canvas, x, y, iter, maxIter, left, artists, baseCallback) = return baseCallback(x, y); } const ctx = canvas.getContext("2d"); + ctx.direction = left === -1 ? "ltr" : "rtl"; const [width, height] = getDimensions(canvas); const drawBranchUp = (xDist, yDist) => drawBranchFrom(ctx, x, y, xDist, yDist, left, -1); @@ -122,7 +122,6 @@ const drawMatchup = (canvas, x, y, iter, maxIter, left, artists, baseCallback) = artists, drawArtist2, ); - ctx.stroke(); } const drawBracket = (canvas, artists) => {