Skip to content
This repository has been archived by the owner on Apr 24, 2020. It is now read-only.

Commit

Permalink
fix(tournaments): very long lines sometimes overlapped a match block
Browse files Browse the repository at this point in the history
closes #77
  • Loading branch information
seiyria committed Oct 29, 2015
1 parent 330286e commit 8a5dbd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/js/directives/draw-to.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ site.directive('drawTo', ($timeout) => {
const targetRound = drawTo[0].r;

// if it's too far away, /2 is not a good midpoint
const modifier = targetRound - myRound === 1 ? 2 : 1.05;
const xModifier = targetRound - myRound === 1 ? 2 : 1;
const subModifier = targetRound - myRound === 1 ? 0 : 10;

const mid = x1+((x2-x1)/modifier);
const mid = x1+((x2-x1)/xModifier) - subModifier;

drawLine(x1, y1, mid, y1);
drawLine(mid, y1, mid, y2);
Expand Down

0 comments on commit 8a5dbd0

Please sign in to comment.