X-Git-Url: https://git.jacobcasper.com/?p=brackets.git;a=blobdiff_plain;f=frontend%2Findex.js;fp=frontend%2Findex.js;h=d49372f39a0b77b18bfbb66482c3cd042a33e7f9;hp=c45341a444cba0ee8fbcffcaf995f8326cd37013;hb=0230aa11e0f67d6b39dd9b0b5dbf3e958f860720;hpb=692ff6424c5d17ed2142211fdd470ac29591d779 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) => {